Questions tagged [django-custom-user]

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

268 questions
1
vote
1 answer

is_staff field is not showing in Django admin

is_staff is defined as boolean field but its checkbox is not visible in the admin page. But is_admin is visible and it can be changed. I can't able to make changes to that field using views.py class Users(AbstractBaseUser, PermissionsMixin): …
1
vote
2 answers

TypeError: create_superuser() missing 3 required positional arguments:

Got the following error when I try to create new superuser using terminal. TypeError: create_superuser() missing 3 required positional arguments: 'first_name', 'last_name', and 'location' I followed another stackoverflow page , in comments below.…
1
vote
3 answers

Extending default user using Abstract User

I am trying to add some extra fields in default user model. But the new fields is not showing up in admin page. Here are the models of 'users' app. models.py from django.db import models from django.contrib.auth.models import AbstractUser class…
Pritam
  • 333
  • 3
  • 13
1
vote
1 answer

how to fix not a callable attribute error in admin.py in custom user model in dajango?

i m just trying to get custom user model. server was running fine when i created User class in model.py and forms in forms.py. but after creating UserAdmin class in admin.py i m getting not a collable attribute error. even i do not have any…
1
vote
1 answer

Django: Subclassing UserCreationForm: doesn't have get_user() method?

I created a custom user in Django by subclassing the normal User model. This user's only difference is that it doesn't have a username. Now, I'm trying to use the built in Django UserCreationForms to log users in. I subclassed UserCreationForm and…
Max
  • 171
  • 1
  • 9
1
vote
2 answers

Django admin error "Please correct the errors below."

I have made custom BaseUserManager to create user but I am getting error of "please correct the errors below" when I add user from django admin panel and I can't find what's going wrong. Models.py: class UserManager(BaseUserManager): def…
1
vote
2 answers

Modify response from Django REST API using CustomUserModel extending default User Model and API classes

I have a Django Project with CustomUserModel. I have extended Django default RegisterView with my CustomRegisterView, and also created CustomLoginView by extending LoginView. Everything works fine, data too get saved with custom fields, and while…
1
vote
1 answer

Django custom user model: IntegrityError: null value in column "is_superuser" violates not-null constraint

I am trying to create a custom user model in Django and thereafter create RESTAPI as per django-rest-auth provides. CustomUserModel and CustomUSerManager are defined as- from django.contrib.auth.models import ( BaseUserManager,…
1
vote
1 answer

"'NoneType' object is not iterable" when adding new user on django custom user model

First of all, I am new to Django. Please tell me if my question is not clear and straightforward. I was trying to make custom user model for my app, everything seems fine until I found error when trying to add new user in the admin page. The error…
TijaniRF
  • 160
  • 2
  • 13
1
vote
1 answer

Django form for creating users with different permissions

I'm working on a Django system where there are four levels of users: 1. Basic (access only) 2. Admin (can update/change/delete) 3. Gatekeeper (can only create Admin users, cannot update/change/delete) 4. Developer (true superuser) I think I have the…
MVM
  • 43
  • 6
1
vote
1 answer

Django custom user model gives error: TypeError: create_superuser() got an unexpected keyword argument 'username'

I'm creating a Django custom user based on a tutorial as below: class UserProfileManager(BaseUserManager): """Helps Django work with our custom user model.""" def create_user(self, email, name, password=None): """Creates a user…
1
vote
0 answers

Error in Customizing Default User Class in Django

I wanted to add some more fields to Django's default User model I imported AbstractUser and inherit it in my User class and added my app to INSTALLED_APPS and added this line in settings.py AUTH_USER_MODEL='music.User' in which music is my app's…
Mahdi Sorkhmiri
  • 356
  • 2
  • 4
  • 16
1
vote
1 answer

Django CreateView autofill custom user

I want to use Django's GCBV CreateView to autofill the created_by field on my model with the current user. The official docs have a good example here but I'm using a custom user model and having trouble making it work. Here's my current setup: #…
wsvincent
  • 207
  • 4
  • 13
1
vote
2 answers

django - cannot login after create custom user model

I created my own user model and usermanager model. Then I tried to create a supersuser and get "Superuser created successfully." However, when I tried to login with all the info, it failed. Then I added a line of code to print my password while…
Jieke Wei
  • 173
  • 2
  • 13
1
vote
0 answers

django's get_user_model() only in 1.11 during import time

I've created this draft of a reusable app: django-separate-users. It basically works :) But, this code only runs on django 1.11+. The problem is right here, the call to get_user_model(): models.py. The docs state, that in 1.11 "The ability to call…
benzkji
  • 1,718
  • 20
  • 41