Questions tagged [django-custom-user]

Tag for questions related to custom User model functionality introduced in Django 1.6

268 questions
0
votes
2 answers

Any Possibility to put condition on Password Required in Django Custom Auth?

I want the registered user to log in with the Email or PhoneNumber and the Password first. If the user forgot the Password then there should be the possibility to log in with OTP bypassing the Password which would be provided via SMS on the User…
Faisal Nazik
  • 2,367
  • 4
  • 17
  • 40
0
votes
1 answer

All the testcases have assertion error: 401 !=200 django

I have a custom abstract base user and basic login with knox view, I made some simple tests to the register and login process, however all the testcases fail to assertion error:401!=200 and when I use pdb.set_trace to know the sent data it always…
0
votes
2 answers

when I create super user for custom user model, its dont provide me username, firstname, lastname filed then its show error

when I create super user for custom user model, its dont provide me username, firstname, lastname filed then its show this error: MyAccountManager.create_superuser() missing 3 required positional arguments: 'first_name', 'last_name', and…
0
votes
1 answer

Manager isn't available; 'auth.User' has been swapped for 'accounts.User'

I have created a custom user model 'User' and have declared in settings.py as AUTH_USER_MODEL Also i have two other models consumer and workman which has an onetoone relation with my custom user. i created two forms for registering customer and…
0
votes
1 answer

DRF simple-jwt error "detail": "No active account found with the given credentials"

I can create an account with DRF_simple_jwt but when it comes to loging in to that account, it says {"detail":"No active account found with the given credentials"} I tried googling and tried this and more but all in vain . I don't know where the…
0
votes
1 answer

django.db.utils.OperationalError: no such table: MainApp_user when i try to create superuser

I make some web application, and almost in the end of development process i decided to customize user model to make profile page with many other info. Recently i have found a video where example from django docs is explained, and i made the same…
user17228732
0
votes
1 answer

Custom user model object not created after allauth signup

I'm trying to create a custom user object (Author model) right after a new user signs up using allauth's signal, the signup works fine and the User is created but the object (Author) is not being created. This is my Author (custom user) model: class…
0
votes
0 answers

How to create multiple types of users using OneToOne field in Django?

I want to create 2 types of users - Customer and Company. I've already created a custom user shown below. These are their model files - class UserManager(BaseUserManager): """Define a model manager for User model with no username field.""" …
0
votes
2 answers

How to create 2 types of users in Django?

I want to create 2 types of users in my Django project namely Customer and Company. Both the users have different attributes for registration process. Here is my user odel.py file - class UserManager(BaseUserManager): use_in_migrations = True def…
0
votes
0 answers

Django SuperUser to use standard User model and have app users use CustomUser model

I have an app where I won't be needing email/username or passwords for User authentication. However, I want my superuser to still use the username and password authentication. Basically, how do I force superusers to use the built-in Django User…
0
votes
1 answer

"django.db.utils.ProgrammingError: relation "account_account" does not exist" while using Oauth for API with custom User Model

I am trying to create a API with OAuth 2 Authentication. I have created custom user models called Accounts. When I am running the command "py manage.py migrate" it is throwing me the below error. E:\Django\api\app>py manage.py migrate …
Abdul
  • 176
  • 3
  • 19
0
votes
2 answers

Get error messages in django_rest_framework in a json format

I want to get an error message { "phone": [ "user with this phone already exists." ] } in a JSON format like {"error": "user with this phone already exists."} from the response HTTP 400 Bad Request Allow: GET, POST, HEAD,…
codenerd
  • 1
  • 1
  • 2
0
votes
2 answers

Django Abstract User - how to implement it with allauth

I don't have the standard Django User model to rely on. How would you combine both, AbstractUser and Allauth. Should I build out the views first "SignUpView.as_view" or should I work out how how the path "accounts/" should tie in with allauth? I was…
0
votes
0 answers

Check fields/fieldsets/exclude attributes of class CustomUserAdmin error in admin

I am getting this error even though I have already removed and migrated again. Initially, I added as extra boolean field is_vehicle_owner after Abstracting a Usermodel and then it was removed later. But i get this error. Any help will be…
0
votes
0 answers

Django custom login, how can I add ForeignKey to REQUIRED_FILED

I tried to create a custom login for Django, and one of the fields in User(AbstractBaseUser) class User(AbstractBaseUser): user_email = models.EmailField(verbose_name='Email right here', max_length=70, unique=True, primary_key=True) …
vinh tran
  • 175
  • 1
  • 2
  • 7