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

Customize update_last_login in Django

This is django update_last_login: #django.contrib.auth def update_last_login(sender, user, **kwargs): """ A signal receiver which updates the last_login date for the user logging in. """ user.last_login =…
rahnama7m
  • 865
  • 10
  • 38
2
votes
1 answer

Django createsuperuser throws django.core.exceptions.FieldDoesNotExist: User has no field named ' ' error

When i try to create a superuser using python manage.py createsuperuser command, it throws the following error : Username: wcud Traceback (most recent call last): File "/home/Music/ENV/lib/python3.5/site-packages/django/db/models/options.py",…
FightWithCode
  • 2,190
  • 1
  • 13
  • 24
2
votes
1 answer

Django user signup using custom user model not working

I have a Django custom user model 'es_user' which inherit the Django's default user model. when a user signup it works fine but that user will be part of 'Users' and nothing will add upto es_user. so each time a user sign up I've to go to admin…
Adarsh D
  • 511
  • 6
  • 14
2
votes
1 answer

django.core.exceptions.ImproperlyConfigured: AUTH_USER_MODEL refers to model 'webservice_again.CustomUser' that has not been installed

Complete Error: "AUTH_USER_MODEL refers to model '%s' that has not been installed" % settings.AUTH_USER_MODEL django.core.exceptions.ImproperlyConfigured: AUTH_USER_MODEL refers to model 'webservice_again.CustomUser' that has not been…
Rahul G
  • 51
  • 4
2
votes
0 answers

widget css Attribute not updating Authentication form django 2.1

Sorry for stupid question as i am new to programming. (Start out as a hobby and now starting a project to replace work-related task rather than using excel) trying to customize user model and extending django user models and authenication form but…
2
votes
1 answer

Django User Profile doesn't update

I am setting up a website in Django, where users can see their profiles and update details (like email, password, etc) or delete own account. But updating the form is not acknowledged at all by the user. I am using the standard built-in User model.…
Zuz
  • 57
  • 4
2
votes
1 answer

django: Extending user model using one-to-one: how to save() Profile model's fields

I have a basic Django application, wherein along with the User model I have extended the Profile model using One-to-one field. Models.py class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE, null=True) …
Simran
  • 593
  • 1
  • 14
  • 37
2
votes
1 answer

Django: Programmatically add Groups on User save

After a user is saved, I need to make sure that its instance is associated with a group by default. I have found two ways to achieve that: Overriding the model's save() method models.py: from django.contrib.auth.models import AbstractUser,…
raratiru
  • 8,748
  • 4
  • 73
  • 113
2
votes
1 answer

Django template url NoReverseMatch for re_path

I am attempting to make a validation link e-mail as part of my user sign-up in Django. I have a {% url %} tag in my template however it is giving me a NoReverseMatch error with regards to the uid & token variables. Here is the code in the…
Zexelon
  • 495
  • 5
  • 18
2
votes
2 answers

Add user to permission group when creating user in Django Admin

I would to add a User to a permission group automatically when create a User. I have hear about user.groups.add(group) and group.user_set.add(user). But it doesn't work. My final purpose is to have 3 kind of users: SuperAdmin: One superadmin to…
Antonio Maestre
  • 123
  • 4
  • 14
2
votes
1 answer

How to set up django user permissions with one user having multiple permissions?

I've got the following idea. One user can be in multiple companies. The user has different permissions in every company that he or she is in. The example below doesn't work, because one user would always have the same permissions. How should I set…
2
votes
2 answers

User Follower model on Django. Cannot use add() on a ManyToManyField which specifies an intermediary model. Use accounts.Contact's Manager instead

I am new to Django, Please forgive any silly mistakes in code or logic, Intro: I am trying to create a user follower model in Django. Where users can follow and unfollow other users on the sites Error: I have made the models for my follow/unfollow…
Samir Tendulkar
  • 1,151
  • 3
  • 19
  • 47
2
votes
0 answers

Is custom Django user model with only one field possible?

I need a custom user model in Django with only one field to authenticate. Because the users of my website will not have an email or password. They will be logged in with only one string (like token generated immediately). If the string matches with…
user5721897
2
votes
1 answer

Why can't I authenticate a Django user created from a custom manage.py command?

This one has me completely stumped. I have a model which extends the base User model in Django, so I am writing a custom manage.py command to create superusers. It seems to be working fine, but for some reason any users that I create via this custom…
2
votes
0 answers

Linking todolist to a user

I am creating a web application that allows a user to create a todolist where they can add, delete, and edit todo list items (todos). I am using the django framework to do so and I have gotten it to work for the most part. So far, I have implemented…
Zelda
  • 47
  • 1
  • 10