Git Product home page Git Product logo

Comments (6)

jcugat avatar jcugat commented on July 30, 2024 1

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.

jcugat avatar jcugat commented on July 30, 2024

Which version of Django are you using?

from django-custom-user.

Plorenzo avatar Plorenzo commented on July 30, 2024

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.

jcugat avatar jcugat commented on July 30, 2024

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.

Plorenzo avatar Plorenzo commented on July 30, 2024

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.

Plorenzo avatar Plorenzo commented on July 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.