Linked Questions
11 questions linked to/from AbstractUser vs AbstractBaseUser in Django?
552 votes
17 answers
347k views
What's the best way to extend the User model in Django?
What's the best way to extend the User model (bundled with Django's authentication app) with custom fields? I would also possibly like to use the email as the username (for authentication purposes). ...
138 votes
20 answers
142k views
Django - Login with Email
I want django to authenticate users via email, not via usernames. One way can be providing email value as username value, but I dont want that. Reason being, I've a url /profile/<username>/, ...
4 votes
1 answer
4k views
When to use "AbstractBaseUser" in Django?
What is the difference between these two and what is the purpose of AbstractBaseUser when I can give any field to User model? Which one is better to use with python-social-auth? class User(models....
2 votes
2 answers
3k views
How to override username max_length in Django?
I'm using Django 1.9, where usernames have a 30 character limit. In order to overcome this, I created a custom user model as such: class User(AbstractUser): pass # Override username max_length ...
3 votes
1 answer
2k views
Customizing the Django User model - username as a Primary Key attribute
How to can I create my own user model in Django, in which I want that my P.K be the username field and not the id field autogenerated by Django? I am trying the following: I've create the ...
0 votes
1 answer
2k views
Django save user as inactive
Why doing something so simple seems so complicated in Django? It started with setting up a user model where email is used to login, a pain... Now I am trying to save a user as user.is_active = False ...
0 votes
1 answer
916 views
rename unique field in django model and migrate
I had a model which looks like this: from django.db import models from django.contrib.auth.models import AbstractUser class User(AbstractUser): username = models.TextField(max_length=100, unique=...
0 votes
1 answer
491 views
Can I create an instance of AbstractUser in my model class in the model.py in django?
I am new to django and from a tutorial video, in the model.py file for the profile app, he created an instance of the User model in a one-to-one relationship with the profile model class like so: ` ...
1 vote
0 answers
522 views
Can't create superuser after customising userprofile
I can't create superuser in Django after customising userprofile. When I run manage.py syncdb: TypeError: create_superuser() takes exactly 4 arguments (3 given) This is my userprofile model: ...
2 votes
0 answers
328 views
Django attribute error while creating superuser
I've created a custom user model using AbstractBaseUser. When I try to create a super user using terminal via createsuperuser command. I get in create_superuser user.is_staff = True AttributeError:...
1 vote
1 answer
223 views
Django custom auth model registration form returns unique username error
I have my own user model called User. I have a user registration form that returns this error below: duplicate key value violates unique constraint "users_user_username_06e46fe6_uniq" DETAIL: Key (...