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
0
votes
2 answers

Cannot assign - must be a "UserProfile" instance

I have a class UserProfile defined which takes the default user as a foreign key. Now another class A has a foreign key to UserProfile. So for saving any instance in class A, how do i give it the userprofile object. Also, does making a class…
zubinmehta
  • 4,368
  • 7
  • 33
  • 51
0
votes
1 answer

What to use django user object or create a user model?

I want to create a user for my website that can submit a request form but I'm wondering which is suitable choice : To use a user object that already created Create a user model from scratch Note: I will let the users to login in my website from…
Hannah
  • 65
  • 1
  • 9
0
votes
1 answer

Django user audit

I would like to create a view with a table that lists all changes (created/modified) that a user has made on/for any object. The Django Admin site has similar functionality but this only works for objects created/altered in the admin. All my models…
SaeX
  • 17,240
  • 16
  • 77
  • 97
0
votes
2 answers

Error: MyUser matching query does not exist - Django

I am trying to include the username in the url, but I can no longer logout without getting this error: It traces back to this line in views.py: u = MyUser.objects.get(username=username) Any idea what I'm doing wrong? Here is my…
jph
  • 347
  • 2
  • 7
  • 18
0
votes
1 answer

django 1.7 admin: 'ModelMultipleChoiceField' object has no attribute 'limit_choices_to'

I'm working on a legacy django 1.4 project, porting it to django 1.7. When accessing the django admin interface, in order to show user data I get the aforementioned error. Environment: Request Method: GET Request URL:…
furins
  • 4,979
  • 1
  • 39
  • 57
0
votes
1 answer

Django: resetting password without a CSRF token

I have a Django website that manages Users. Using the built-in functionality, users can request a password reset from the website and that works great. I have implemented it according to this tutorial so I am using the built-in password reset…
Vlad Schnakovszki
  • 8,434
  • 6
  • 80
  • 114
0
votes
1 answer

Django multiple level user handling

What is the best way to design a multiple level user login system using django and postgresql. The user details are head(Admin), students, teachers,staffs etc. These different types of user details have different fields and we can't alter that…
Anju
  • 137
  • 2
  • 10
0
votes
1 answer

Django:Profiles under auth.Group where auth.Group is used as foreign key in the app model

I want to display the dashboards which are under the group of logged in user, and I already have logged in user information and group-name of that user so far my views.py is def custom_login(request): if request.user.is_authenticated(): …
jay j
  • 285
  • 1
  • 6
  • 16
0
votes
1 answer

Updating user in django

In my application, I used email and password for user authentication, which works fine. However, I want to offer the user the option of adding other information to their account like first names, last names, and dates of birth. I have a change form…
erip
  • 16,374
  • 11
  • 66
  • 121
0
votes
1 answer

User matching query does not exist - django

I have a page which shows the user and their about. And in that, there's a link to update their about. But when I open that link it shows me with this error: DoesNotExist at /profile/user/update_about/ User matching query does not exist. And the…
Kakar
  • 5,354
  • 10
  • 55
  • 93
0
votes
2 answers

How to create a UserProfile field which is alias for a User field?

I want access User model's first_name, last_name and email fields from UserProfile as if they were UserProfile's own fields. class Person(models.Model): user = models.OneToOneField(User) name = #ModelField which refers to user.first_name …
Sashko Lykhenko
  • 1,554
  • 4
  • 20
  • 36
0
votes
1 answer

Django: How to handle User data validation the right way?

In my app, I have a custom User model with extra fields like gender, birth_date, etc. I usually create/update Users using different ways (web services in REST API, Django forms), this means I can't count on Form validation to validate users…
David Dahan
  • 10,576
  • 11
  • 64
  • 137
0
votes
0 answers

Creating a login page for custom Django users?

I am trying to write a webapp that allows users to match, and meet other users, based on interests. I am in early stages and have written a registration page, and used a custom user model to register users. I'd like those users to be able to login…
MrW
  • 173
  • 1
  • 1
  • 12
0
votes
1 answer

Requesting user-only page without context

I have a login webpage which authenticates the user correctly. When login page accepts user info and sends them to a default logged in page, django correctly gets user info and populates the page accordingly. Also, when sent to login page from…
Mirac7
  • 1,566
  • 4
  • 26
  • 44
0
votes
0 answers

Setting up multiple user account types in django running mezzanine

I've been banging my head against a wall here for some time it seems and so I'd like to put the questions out to you guys. I'm building an application that has multiple user account types, let's say 3 types. My models.py looks something like: class…
Siddharth Kumar
  • 134
  • 1
  • 7