Tag for questions related to custom User model functionality introduced in Django 1.6
Questions tagged [django-custom-user]
268 questions
0
votes
1 answer
CustomAuthBackend() missing 1 required positional argument: 'ModelBackend'
My models were fine, migrate successfully and I am able to create superuser. I am not able to go to admin login page as the error shows up "CustomAuthBackend() missing 1 required positional argument: 'ModelBackend'"
In Custom Backends:
def…

Varun Singhal
- 21
- 1
0
votes
1 answer
I created a custom UserModel in Django and when i make migrations, it gives this error "AttributeError: 'str' object has no attribute '_meta' "
I am new to django and i created a CustomUserModel and a form for user registration. But when i make migration, it gives me the following error:
> File "", line 219, in
> _call_with_frames_removed File…

Itzz_CJ
- 70
- 5
0
votes
2 answers
How to allow blank password via django-rest-api user create
In my case, I need to have one user group which email and password will not be set on user creation. They will not require to auth themselves either.
I managed to do custom user with a nullable email, but I cannot find a way to allow blank password…

wecoon
- 155
- 1
- 11
0
votes
0 answers
django.db.utils.IntegrityError: UNIQUE constraint failed: authentication_user.email
I am trying create user through an API, But i am struck on above error.
Below are the code of the User and its manager. Here, I am creating custom user model.
class UserManager(BaseUserManager):
def create_user(self,username,email,…

Gaurav Kumar
- 41
- 1
- 9
0
votes
1 answer
Dual authentication in Djnago
I would like to have different types of Users in Django (say Driver and Passenger). So I want both email (with password for Driver) and phone number (with password + OTP for Passenger) authentication.
So I have created custom authentication back end…

Uzama Zaid
- 374
- 3
- 10
0
votes
1 answer
Custom User with "USERNAME_FIELD" non-unique in Django
Situation:
We have an existing system where current employee logins to the system using their mobile number.
But as same mobile number can be used by multiple users, so there is constraint in existing db that, at any moment there can be only one…

mesajidiqbal
- 11
- 2
0
votes
3 answers
Can't login to django admin after successfully creating a super user with a custom user model
imm trying to login to the django admin panel with a successfully created superuser but cannot get the right username/pw combo right.
I want users to just use their email as their username. I've deleted migrations, sycndb, and everything works…

orynnnnn
- 101
- 3
- 13
0
votes
1 answer
Django custom user model with BaseUserManager set is_active=True not working
I'm working on a project using Python(3.7) & Django(3) in which I have implemented a custom user model and inside the User manager, under create_user method I set user.is_active = True but it's not working on signup.
Here's my implementation:
class…

Abdul Rehman
- 5,326
- 9
- 77
- 150
0
votes
1 answer
Add custom users with a specific attribute to the 'friends' list
I have implemented the logic of adding users to the 'friend list' from the whole list of users.
models.py
class VendorList(models.Model):
users = models.ManyToManyField(User)
current_user = models.ForeignKey(User, related_name='owner',…

Azamat Uzbekov
- 150
- 12
0
votes
1 answer
You can't execute queries until the end of the 'atomic' block
I was creating custom user in django for that i wrote following code in initial migration file but when we hit migrate command it gives TransactionManagementError
0001_initial.py
from django.db import migrations
from api.user.models import…

Pawan Khande
- 1
- 1
- 1
0
votes
0 answers
I have a question about django rest auth customization
I'm trying to solve some of the things that don't fit me in the current django rest auth.
First of all, I would like to make it possible to sign up as a member only once I enter the password without using password2 in the rest auth.
And when I sign…

leedjango
- 411
- 2
- 9
- 18
0
votes
1 answer
I can't log in to admin site in django
I am currently using a custom user model in django. After creating the user model and Migrating to db, we created the superuser account and ran the server. But after accessing the admin page, I entered my information correctly, but I couldn't log…

leedjango
- 411
- 2
- 9
- 18
0
votes
1 answer
django custom user can't set attribute error
I followed CodingEntrepreneurs tutorial on Custom Users and extended it to have 3 types of users: school, parent and vendor.
I have created view, form for each type of user.
In forms.py I have
class ParentSignUpForm(forms.ModelForm):
"""A form…

Azamat Uzbekov
- 150
- 12
0
votes
1 answer
how to login with registered phone number and password in Django
here is the code for registration with email and password but how to do with phone number i have
models.py
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
class…

Tikam Suvasiya
- 1
- 1
0
votes
2 answers
Django Custom User Model Failes to encrypt password from admin site
I have created a custom user model by inheriting AbstractBaseUser, PermissionsMixin and also created a Custom Manager for creating users and superuser. But when I try to add new user from Django admin site, it fails to encrypt the password field and…

Fahad Md Kamal
- 243
- 6
- 20