Questions tagged [django-custom-user]

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

268 questions
93
votes
6 answers

Using Django auth UserAdmin for a custom user model

From the Django.Contrib.Auth docs: Extending Django’s default User If you’re entirely happy with Django’s User model and you just want to add some additional profile information, you can simply subclass django.contrib.auth.models.AbstractUser and…
17
votes
10 answers

TypeError: create_superuser() missing 1 required positional argument: 'profile_picture'

I get the following error after adding the profile_picture field: TypeError: create_superuser() missing 1 required positional argument: 'profile_picture' This profile_picture field is an "ImageField" set as "Null = True". I have tried the…
10
votes
2 answers

"django.contrib.admin.sites.NotRegistered: The model User is not registered" I get this error when a want to register my Custom User.

I overwrite default model AbstractUse for authorization through email. applications.account.models.py # -*- coding: utf-8 -*- import datetime from django.db import models from django.contrib.auth.models import AbstractUser class…
8
votes
2 answers

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

i have problem with my code when i want signup error appear Manager isn't available; 'auth.User' has been swapped for 'members.CustomUser' , i try solotion of other questions same like Manager isn't available; 'auth.User' has been swapped for…
mehdi
  • 1,100
  • 1
  • 11
  • 27
8
votes
1 answer

Why authenticate() return None for inactive users?

I have CustomUser like following : class CustomUser(AbstractBaseUser, PermissionsMixin): email = models.EmailField(max_length=100, unique=True) username = models.CharField(max_length=20, unique=True) …
dan
  • 141
  • 3
  • 9
7
votes
5 answers

login() missing 1 required positional argument: 'user'

Here is my view, def login_view(request) : if request.method == 'POST': form = LoginForm(request.POST) if form.is_valid(): email = form.cleaned_data['email'] password = form.cleaned_data['password'] …
AJAY RAWAT
  • 81
  • 1
  • 1
  • 3
7
votes
1 answer

Adding extra field in admin for custom user in Django 1.11

I have a custom user model which is subclassed by AbstractUser with an added custom field. # model.py from django.db import models from django.contrib.auth.models import AbstractUser class CustomUser(AbstractUser): ADM = 'admin' MEMBER =…
Demetris
  • 2,981
  • 2
  • 25
  • 33
7
votes
1 answer

How to authenticate a User

I have created two different types of users - truck & company. Here is my registration page for a user After registering, the data about whether the user is a truck or company will go to the database. In my login page, only Email and Password are…
vanam
  • 135
  • 1
  • 4
  • 14
7
votes
3 answers

How add group for custom user in django?

I created custom model of user using this official docs customizing authentication in Django But how can add groups and premissions? My django is version 1.9
6
votes
2 answers

Custom User model error: AttributeError: 'CustomUser' object has no attribute 'is_anonymous'

Trying to set up a custom user model that extends the base user. Some user will have login information and some will not, but I still want all users logged. That's what I think the error is saying. In the default Django model they were logged, but…
user11846186
6
votes
2 answers

Access django-custom-user manager method in migration

I'd like to seed a superuser record in a data migration for a django 1.7 project. I'm using the django-custom-user app. My migration looks like this: # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models,…
novon
  • 973
  • 3
  • 15
  • 30
6
votes
3 answers

Custom user in django raises ValueError

Even this simple example throws a ValueError: Dependency on app with no migrations: myApp during python manage.py syncdb myApp/models.py from django.contrib.auth.models import AbstractUser class User(AbstractUser): …
Ben
  • 6,986
  • 6
  • 44
  • 71
6
votes
1 answer

django-allauth: custom user generates IntegrityError at /accounts/signup/ (custom fields are nulled or lost)

I'm trying to integrate django-allauth with a custom user model (subclassed AbstractUser, but when I test the signup form I get an integrity error due to field (date_of_birth) being null, but the value submitted was u'1976-4-6' I'm learning the new…
Peter Hanley
  • 1,254
  • 1
  • 11
  • 19
5
votes
3 answers

Unknown field(s) (username) specified for User. Check fields/fieldsets/exclude attributes of class CustomUserAdmin

After creating a custom user for my python django app, i started getting the error stated on the title. It only happens when i wan't to add a new user from the admin panel that's when i get the error "Unknown field(s) (username) specified for User.…
5
votes
1 answer

Writing Django signup form tests for checking new user creation

Implemented a custom user model in Django and allows user to signup using the url http://127.0.0.1:8000/users/signup/. A GET request on this url is displayed like this: I have written tests for this page. Tests for get is working as expected. I…
nitin_cherian
  • 6,405
  • 21
  • 76
  • 127
1
2 3
17 18