Questions tagged [django-custom-user]

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

218 questions
86
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…
8
votes
5 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…
7
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…
6
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,139
  • 1
  • 20
  • 29
6
votes
1 answer

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
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
  • 5,979
  • 5
  • 32
  • 63
5
votes
1 answer

How to fix "TypeError: argument of type 'ConnectionHandler' is not iterable" when running a django test?

When I do ```python -m unittest`` inside of my users app, I get this error: TypeError: argument of type 'ConnectionHandler' is not iterable I was customizing my User model in django and I wanted to make a test for it. I already did the migrations…
5
votes
4 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
  • 61
  • 1
  • 3
5
votes
1 answer

Django Creating a Custom User with the Django Rest Framework

I'm trying to create a custom user using the Django Rest Framework. I got it to the point to where I can create a regular user, but I'm unsure on how to extend it to the custom user model. models.py: from django.db import models from…
5
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
  • 853
  • 2
  • 13
  • 29
5
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,204
  • 1
  • 11
  • 18
4
votes
1 answer

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
4
votes
3 answers

Wagtail: Add image to custom user model

I'm following the Wagtail documentation to customize the user model. I want to add an image to the user model. Django version: 2.0.8, Wagtail version: 2.1 Problem After choosing an image with the image chooser field and clicking 'Save', this error…
jayhaluska
  • 45
  • 6
4
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…
4
votes
1 answer

Django: is extending AbstractBaseUser required to use email as USERNAME_FIELD?

Like many others, I'm trying to configure my Django app to use the email as the username field. I have some existing user accounts that I migrated to a custom user model successfully, though right now the custom model is identical to the Django user…
dkhaupt
  • 1,800
  • 2
  • 17
  • 34
1
2 3
14 15