Questions tagged [django-users]

User model is the default model in Django. It provides many APIs which are helpful for working with users. Django user model is overridable in a Project according to required field.

Django(a high-level Python Web framework) comes with a user authentication system. It handles user accounts, groups, permissions and cookie-based user sessions.

894 questions
-1
votes
1 answer

Cannot assign "": "UserProfileInfo.user" must be a "User" instance

[enter image description here][1]I don't know what is causing this error but i couldn't find any solution for this. i checked everything and everything seems to be fine but i don't know why this error is occuring. Views.py from django.contrib.auth…
Rahul
  • 17
  • 6
-1
votes
1 answer

Why does adding 'User' to my Model gives me an Internal Server Error? (Django)

My Django App was working fine until I added this 'author' field to my Model: from django.db import models from django.contrib.auth.models import User class Post(models.Model): author = models.ForeignKey(User, on_delete=models.CASCADE) content =…
Mateo
  • 9
  • 1
-1
votes
1 answer

How to create a user in Django with extra fields

I want to know how do I create users in Django. I can use User.objects.create_user() but I can only store username, email, password, first name, last name. I see that django.contrib.auth.forms is depreciated so I cannot UserCreationForm. What if I…
Anshul Gupta
  • 265
  • 2
  • 12
-1
votes
1 answer

Getting Token from Django Model to views

I created a user model in Django i want to know what JWT token is generated for my particular user in the views.py section could you please help class User(AbstractBaseUser, PermissionsMixin): username = models.CharField(max_length=255,…
-1
votes
1 answer

DoesNotExist error when using custom User model

I have a Group model in my group/models.py file: class Group(models.Model): leader = models.ForeignKey(User, on_delete=models.CASCADE) name = models.CharField(max_length=55) description = models.TextField() joined =…
-1
votes
1 answer

User() got an unexpected keyword argument 'profile_image' when creating user

i created a user registration form using from django.contrib.auth.models import User, auth but when i try to submit the form instead of creating a new user it's throws me an error like: TypeError at /register/ User() got an unexpected keyword…
user18982103
-1
votes
1 answer

What mistake am I making to cause these Django E304 errors?

I cannot for the life of me figure out what I'm doing wrong here, any help would be very much appreciated! The Goal: We have admins and appraisers signing up on the site. Admins can of course do everything you'd expect from the /admin site and…
ep_dev
  • 81
  • 1
  • 3
-1
votes
1 answer

TypeError in view: Field expected a number but got ' '

it's my first time posting a question in stack overflow so bear with me :D I'm trying to create a staff model from a form but an error keep persisting This is my models file : class CustomUser(AbstractUser): user_type_data = ((1, "HOD"), (2,…
Ksiks
  • 35
  • 5
-1
votes
1 answer

Why django is accepting two diiferent passwords? Giving no error at all

Why this code is accepting both password and confirm_password field? without errors Here is first models.py file: (indent is not a problem here) from django.db import models from django.contrib.auth.models import AbstractBaseUser from .managers…
Rajat Jog
  • 197
  • 1
  • 10
-1
votes
1 answer

Field 'id' expected a number but got 'std1', how do I get the ForeignKey ID of a Model field to use in Django Form?

I have Detail Model, which have the ForeignKey of the Django's default User Model. I created a Form to take the input from user and update the Detail Model fields if it exists else create a new detail. For this purpose, I am filtering the…
Khubaib Khawar
  • 51
  • 1
  • 11
-1
votes
1 answer

2 level of users in django

I am into development of a web based business application using django which will be used by 3 different companies. The business process is exactly same. I have stucked at user creation. I need 2 level of users. First the comany detail (higher…
Ranu Vijay
  • 1,137
  • 9
  • 18
-1
votes
1 answer

how to fixe django.contrib.auth.models.AnonymousUser to User

Hi everyone I'm making ecommerce web project and I try to associate user to carts but i have problem with is_authenticated() method when the user is login it's work but it's is logout it's show this error "ValueError: Cannot assign…
blocs law
  • 3
  • 3
-1
votes
1 answer

Session with Django

In a Home page, i have a form login. in the view.index of the app "Home", after authenticate, i create the ssesion. And after, i call the app "Places" if the authenticate is okey, request.session['user'] =…
QDex
  • 139
  • 9
-1
votes
1 answer

How to model Facebook access tokens and user accounts

I'm building an app that allows users to sign up with facebook login. Facebook login gives us an expiring access token. So far I've thought through having the phone app collect the facebook access token itself and it should POST it to the api. The…
-1
votes
1 answer

Query to extended user model returning error

I am receiving an error when making the following query: Election.objects.all().exclude(candidate__UserID=request.user).filter(Gender=request.user.Profile.Gender).filter(CandidateReg=True) To this model: class Election(models.Model): Name =…
cbuch1800
  • 923
  • 3
  • 11
  • 26
1 2 3
59
60