Comments (6)
Oh, I see. You need to change the setting AUTH_USER_MODEL
to point to your subclassed model. From your error message, I think it should be:
AUTH_USER_MODEL = 'accounts.UserData'
Can you check if works now?
I see this is not clear enough in the docs, will update them to explain it with more detail.
from django-custom-user.
Which version of Django are you using?
from django-custom-user.
I`m having a similar problem in the last beta of 1.7(1.7c2). Here is my model:
from custom_user.models import AbstractEmailUser
from django.db import models
class UserData(AbstractEmailUser):
date_of_birth = models.DateField()
And here is the error I'm getting:
CommandError: System check identified some issues:
ERRORS:
accounts.UserData.groups: (fields.E304) Reverse accessor for 'UserData.groups' clashes with reverse accessor for 'EmailUser.groups'.
HINT: Add or change a related_name argument to the definition for 'UserData.groups' or 'EmailUser.groups'.
accounts.UserData.user_permissions: (fields.E304) Reverse accessor for 'UserData.user_permissions' clashes with reverse accessor for 'EmailUser.user_permissions'.
HINT: Add or change a related_name argument to the definition for 'UserData.user_permissions' or 'EmailUser.user_permissions'.
custom_user.EmailUser.groups: (fields.E304) Reverse accessor for 'EmailUser.groups' clashes with reverse accessor for 'UserData.groups'.
HINT: Add or change a related_name argument to the definition for 'EmailUser.groups' or 'UserData.groups'.
custom_user.EmailUser.user_permissions: (fields.E304) Reverse accessor for 'EmailUser.user_permissions' clashes with reverse accessor for 'UserData.user_permissions'.
HINT: Add or change a related_name argument to the definition for 'EmailUser.user_permissions' or 'UserData.user_permissions'.
from django-custom-user.
I'm not able to reproduce it. Can you paste your django settings file? I want to check INSTALLED_APPS
and AUTH_USER_MODEL
.
from django-custom-user.
Sure, this is my settings.py
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')]
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '***'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'custom_user',
'accounts',
'market',
)
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
ROOT_URLCONF = 'foodProyect.urls'
WSGI_APPLICATION = 'foodProyect.wsgi.application'
# Database
# https://docs.djangoproject.com/en/dev/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'food',
'USER': '',
'PASSWORD': '',
'HOST': 'localhost',
'PORT': '',
}
}
# Internationalization
# https://docs.djangoproject.com/en/dev/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'Europe/Madrid'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/dev/howto/static-files/
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
LOGIN_URL = '/inicio-sesion/'
AUTH_USER_MODEL = 'custom_user.EmailUser'
from django-custom-user.
Now it's working fine.
Yes, the docs are a little bit unclear, an update will be appreciated.
Thank you
from django-custom-user.
Related Issues (20)
- Password field showing as editable in admin when extending EmailUser HOT 1
- Edit New issue Subclassing AbstractEmailUser does not prompt for superuser on syncdb to blank database HOT 2
- ImportError: No module named 'custom_usermail' after install HOT 1
- A server error occurred. Please contact the administrator. HOT 3
- Bad Syntax in Readme? HOT 1
- Fix test error in Django 1.7.2
- Instructions aren't quite complete HOT 8
- Not the same behavior as Django's default User HOT 5
- Problem extending EmailUser HOT 1
- EmailUser considers [email protected] and [email protected] different users HOT 11
- migration not included in python package, causing migrations not to run HOT 6
- MySQL error on migration: (1071, 'Specified key was too long; max key length is 767 bytes') HOT 3
- Not working in Django 1.9 HOT 1
- Change password link in EmailUserChangeForm does not work since Django 1.9 HOT 2
- Prevent user registration - when any UserProfile filed is invalid HOT 1
- "Change password" admin page is missing HOT 7
- Emails are not being validated HOT 1
- never mind please delete
- Deprecation warning for ugettext_lazy HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-custom-user.