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
14
votes
1 answer

Django - User profiles of different types

I have a Django application which allows different kinds of users: firms, administrators, external people etc. Of course all of this is easy to manage with the default authentication system and groups. My problem is that users belonging to different…
Andrea
  • 20,253
  • 23
  • 114
  • 183
13
votes
3 answers

How to limit number of concurrent users logging in to same account in Django

My site is a digital marketplace website written in Django. Digital content(text, images, videos) on the site is 'locked' by default. Only users who bought those content can view it. There's a story that certain user(who bought the content) give…
13
votes
2 answers

User manager methods create() and create_user()

I have encountered with some suspicious behavior of create() method of User object manager. Looks like password field isn't required for creating User object if you use this method. In result you get User with blank password. In case when you use…
sunprophit
  • 1,639
  • 4
  • 16
  • 39
12
votes
2 answers

Remove password from custom Django User model

How to remove the password in the users table and User class in a custom user model? I'm using django-rest-framework token authentication, so i don't need the password field. Here is my model: class CustomUserManager(BaseUserManager): def…
12
votes
1 answer

How to delete user in django?

This may sounds a stupid question but I have difficulty deleting users in django using this view: @staff_member_required def del_user(request, username): try: u = User.objects.get(username = username) u.delete() …
Jand
  • 2,527
  • 12
  • 36
  • 66
12
votes
3 answers

Issue with createsuperuser when implementing custom user model

I am trying to implement my own custom user model in Django 1.6 but I am getting this error. Traceback (most recent call last): File "./manage.py", line 10, in execute_from_command_line(sys.argv) File…
user3282276
  • 3,674
  • 8
  • 32
  • 48
12
votes
2 answers

AbstractUser Django full example

I am new to Django and I have been trying this for weeks, but could not find a way to solve this problem. I want to store additional information like user mobile number, bank name, bank account. And want to store the mobile number while user…
vaibhav1312
  • 863
  • 4
  • 13
  • 31
11
votes
4 answers

How to make django messages StackOverflow style?

I'd like to use Django's Messages module, however, I would like my messages to persist until the user clicks an X next to the message as opposed to having messages disappear as soon as the user reloads the page. I am stumped with two issues: How do…
Yuval Cohen
  • 337
  • 3
  • 7
11
votes
3 answers

Creating users in django (NOT NULL constraint failed: auth_user.last_login)

I'm coding a web app with django and now I'm starting to handle users. I'm trying to do the easy part, just create a new user throught admin interface, but when I try to do it I get a error and I don't find any info about it. I enter django admin,…
rul3s
  • 332
  • 1
  • 2
  • 18
11
votes
3 answers

Setting up two different types of Users in Django 1.5/1.6

Please note--this is an updated version of my original question on this subject, but deserves to be asked again with the change in how Django deals with users and authentication. I'm working on a website with two very different kinds of users--let's…
jdotjdot
  • 16,134
  • 13
  • 66
  • 118
11
votes
3 answers

Turn off user social registration in django-allauth?

I noticed looking through the django-allauth templates there's a signup_closed.html users can be redirected to when user registration is closed or disabled. Does anyone who's familiar with that module know if there's a pre-configured setting that…
Chris B.
  • 1,505
  • 5
  • 26
  • 48
11
votes
1 answer

Sharing Objects with other users in Django

I'm modeling a quite complex system in Django. I will post here only the relevant part of it and I will show simplified use cases diagrams to better express my ideas. I basically have 2 type of users: Seller and Customer. A Seller "acquires" a…
11
votes
3 answers

Exclude username or password from UserChangeForm in Django Auth

I'm trying to figure out a way on how to exclude the username and/or password from the UserChangeForm. I tried both exclude and fields but I doesn't work for these two fields. Here's some code: class ArtistForm(ModelForm): class Meta: …
codingjoe
  • 1,210
  • 15
  • 32
11
votes
1 answer

How to set user.is_staff to True by default in Django Admin?

I need to set the is_staff value to True when creating a user in Admin interface. How can I do that? Thanks
user2066408
  • 397
  • 1
  • 5
  • 8
10
votes
4 answers

Django - How to check all the attributes of a queryset?

I am looking a way to get all the attributes of a variable after we set the value in it using queryset. For example...refer below code... using user.id or user.first_name i can get the value for that attribute. But if i want to check what all other…
1 2
3
59 60