Questions tagged [django-custom-user]

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

268 questions
3
votes
1 answer

Addig form fields to a custom user model in django admin panel

I'm going through the django for beginners book, testing the code from the chapter 8 about the Custom user model. The goal is to add the field age in the auth user model by subclassing the AbstractUser model. First we create out CustomUser in…
Salah Eddine Taouririt
  • 24,925
  • 20
  • 60
  • 96
3
votes
1 answer

Django User Registration with custom user model

I want to create a signup form for a Django custom user model using abstractuser. I don't want anything special, just the ability to later on add custom fields if needed. I understand from the docs that I need to: set AUTH_USER_MODEL define a…
wsvincent
  • 207
  • 4
  • 13
3
votes
1 answer

Django - PermissionRequiredMixin with custom user model as well as AUTHENTICATION_BACKENDS

I am using Django 1.9. When I tried to add PermissionRequiredMixin to my class-based-view, it seems not to work as expected. I created a new user in a auth_group. This auth_group doesn't have any permission to any apps or models. This new user is…
Joey
  • 2,732
  • 11
  • 43
  • 63
3
votes
2 answers

Django: when creating custom user, ValueError: Dependency on unknown app

I'm building a brand-new web project with Python 3.4.3 and Django 1.8 without any migrations made so far. For the project, I'm creating a custom user inheriting from AbstractBaseUser in an app called users. I've also correctly referred…
3
votes
2 answers

Get list of all custom users in template (Django)

I have defined a custom user model, which is working fine and all that. However, in a certain view I would like the user to list all registered users, but I can't seem to get that to work. I was hoping to be able to access all users from the…
axelniklasson
  • 55
  • 1
  • 8
3
votes
0 answers

Django: using abstract base classes and multiple user types with auth system

I need to write a system that can have various types of user logged in, each with their own different set of data stored in the model. My first instinct was to use the new abstract base classes and make my own user types, so I have something…
Tom Carrick
  • 6,349
  • 13
  • 54
  • 78
2
votes
2 answers

Customizing Django Admin Add User With Blank Password

I'm am creating a Django web app with customised users authentication policy: only the superuser has a password and the users identification field is the email field. Normal users are only able to login by OAuth protocol so I don't need to store…
Codename47
  • 295
  • 4
  • 17
2
votes
1 answer

Username appearing in django migrations over custom User model with no username

I have written a custom User model, with no username. Still it appears in migrations as primary key and throws unique constraint error while adding new user. Here is my User Model Manager: class UserManager(BaseUserManager): def create_user(self,…
2
votes
0 answers

Multiple user types with multiple authectication methods in Django

How can i create multiple user types with multiple authentication method. Consider the following scenario. User Types: Admin, Staff, User, Writer, Business Admin and Staff types are need to authenticate with company email address and password Staff…
Uzama Zaid
  • 374
  • 3
  • 10
2
votes
2 answers

TypeError: User() got an unexpected keyword argument 'is_staff' when using CustomUser

I am Creating a Custom User using AbstractBaseUser, but anytime I try to create a superuser, it says TypeError: User() got an unexpected keyword argument 'is_staff' user=self._create_user(email, password, True, True, **extra_fields) File…
David.B
  • 370
  • 6
  • 16
2
votes
1 answer

TypeError: __init__() got an unexpected keyword argument 'instance' for custom user in Django

When I am trying to register a custom user or when i am trying to view profile of login user, i am getting this error. I am not sure why i am getting this error, Here is my code, please suggest where i am doing wrong. Thank you in advance. urls.py #…
2
votes
1 answer

RegisterForm() missing 1 required positional argument: 'request'

So I'm making a custom user model. This is what I'am following Here. I have been pretty much following the tutorial but still I cant make it done. Error: RegisterForm() missing 1 required positional argument: 'request'. here's my code. forms.py from…
Muhammed Mahir
  • 178
  • 4
  • 11
2
votes
2 answers

when I expand my UserAdmin I get an error(__init__() got an unexpected keyword argument 'region') in the admin panel

i'm following a tutorial https://codingwithmitch.com/courses/building-a-website-django-python/ to build a user registration app with django 2.2. my site works just fine exept when I want to add a new user or modify one in the admin panel. this is…
2
votes
1 answer

How to solve the problem of Dual behavior of django CustomUser in migration?

I have a data migration as below in which I want to use create_user method of CustomUser, get an instance of the created user, and use this instance to create instance of Partner model. It is worth mentioning that I have a Partner model that has a…
Amin Ba
  • 1,603
  • 1
  • 13
  • 38
2
votes
3 answers

Custom registration form. Confirm password

I used custom form for register users. I want do validation for confirm password. forms.py: class RegistrationForm(UserCreationForm): '''Register for new users''' email = forms.EmailField(required=True) first_name =…
1 2
3
17 18