Linked Questions

552 votes
17 answers
347k views

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). ...
Farinha's user avatar
  • 18.2k
138 votes
20 answers
142k views

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>/, ...
Praful Bagai's user avatar
  • 17.6k
4 votes
1 answer
4k views

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....
Sam R.'s user avatar
  • 16.4k
2 votes
2 answers
3k views

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 ...
Ariel's user avatar
  • 3,651
3 votes
1 answer
2k views

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 ...
bgarcial's user avatar
  • 3,263
0 votes
1 answer
2k views

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 ...
M3RS's user avatar
  • 7,670
0 votes
1 answer
916 views

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=...
cardamom's user avatar
  • 7,511
0 votes
1 answer
491 views

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: ` ...
theocode's user avatar
1 vote
0 answers
522 views

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: ...
Dan's user avatar
  • 151
2 votes
0 answers
328 views

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:...
Coder's user avatar
  • 21
1 vote
1 answer
223 views

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 (...
Ty C's user avatar
  • 69