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

trying to delete inactive users in django

I am writing a site that sends confirmation emails on signup. Until the user clicks the link, the is_active field is set to false. How can I automatically delete any users who do not click the activation link within a certain period of time? Is this…
2
votes
1 answer

User password reset: Emails not being sent to console

I am currently learning Django, mainly from Andrew Pinkham's book "Django Unleashed", and because the book is prior to Django 2, I cannot use the code in verbatim but adjust the code accordingly. I am currently on Ch. 21 (Extending Authentication).…
cbsteh
  • 809
  • 6
  • 19
2
votes
2 answers

extending default User model in Django

I've written my first application Django 2.0. Everything is working fine and the application is almost ready when I realized to replace id primary key field from default integer type to UUID to make database entry more secure. When I searched for…
Anuj TBE
  • 9,198
  • 27
  • 136
  • 285
2
votes
1 answer

Add uuid field in django Existing User model?

I am using Django Rest framework for my application. I almost implemented registration and login process using django User Model without customizing it now i want to add a uuid field in it. Is there any way we can just add uuid field and other…
2
votes
1 answer

Automatically assign User to user group after register/sign up form submission - Django

I am relatively new to Django, and web development in general. I'm trying to build a website with two types of users, customers, and suppliers. I need to be able to show these two types of customers different things on the website. For example,…
2
votes
2 answers

Python - Django query using auth.User model as OneToOneField

I am using the auth.User model for login info, and a custom UserProfile model for all of a user's profile data. The auth.User.username is a random string. and the UserProfile.user is the same string. When attempting to query the database table…
PhilS
  • 245
  • 7
  • 16
2
votes
1 answer

Django Manager isn't available; 'auth.User' has been swapped for 'users.MyUser'

I created Custom UserModel in Django 1.11 and I need a function which allows users to sign in I think my custom user model is incompatible with my function How can I fix? see error message in the image below : users.models.py from django.db import…
김용식
  • 21
  • 1
  • 3
2
votes
2 answers

Editing default fields' help_text for form in Django (1.11)

For the past couple days I have been trying to solve a strange problem with the default help_text on a form I created to handle user signups. I first noticed the issue when I saw that the html django is inserting as the default help_text is getting…
Jon
  • 432
  • 2
  • 6
  • 20
2
votes
1 answer

Custom Django user model with UUID as the id field

I am trying to extend a User model and add some fields and below is my approach: Class UserProfile(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) mobile_number = models.CharField(max_length=20) gender =…
Shiva Krishna Bavandla
  • 25,548
  • 75
  • 193
  • 313
2
votes
2 answers

Django: Changing/Allowing User's login username to also use his/her e-mail

As my title says, I want to know if I there's a way to allow a user to use not only his username, but also his user's email to login. I want to standardize the login procedure because at the moment I'm having my users use many different conventions…
chiurox
  • 1,549
  • 3
  • 18
  • 28
2
votes
3 answers

django AbstractUser model 'str' object has no attribute '_meta'

I can not register a custom User model in the admin.py. No admin.py , all works fine Why do the customUser? I not know what this is problems. I did everything according to the documentation models.py from django.db import models from…
Тимур
  • 123
  • 1
  • 4
2
votes
0 answers

Custom django permissions based on user profile field(s)

I have extended the django User model by adding a company field: class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE, primary_key=True) company = models.ForeignKey(Companies, on_delete=models.CASCADE,…
fekioh
  • 894
  • 2
  • 9
  • 22
2
votes
1 answer

Django error relation "auth_user" does not exist using multiple database

I'm working on Django 1.9 and python 3.3 project using multiple databases (different schema in a same postgresql database). When I try to migrate the project for the first time, I'm getting this error Running migrations: Rendering model states...…
2
votes
2 answers

Extending django User django-rest_framework gives me KeyError

I'm new to django rest_framework and have and issue, i've extended the auth_user as per the django docs, but is giving me a hard time... models.py class UserProfile(models.Model): user = models.OneToOneField(User, primary_key=True,…
2
votes
3 answers

Django - redirect to login page if UserProfile matching query does not exist error

I have extended the user model using the UserProfile method. However I occasionally get the Django error message UserProfile matching query does not exist when running the query request.user.get_profile() I think this is happening when I have become…
John
  • 21,047
  • 43
  • 114
  • 155