Ian Warner
Ian Warner

Reputation: 1068

Django Auth Model Issue - AUTH_USER_MODEL Not Installed

Trying to debug this error with getting a Django project running

ImproperlyConfigured: AUTH_USER_MODEL refers to model 'accounts.User' that has not been installed

Running

python manage.py migrate

Must iterate i am in no way a python or django expert - I have simply inherited someone elses project that I am trying to get running for the team here.

I have followed steps to

install postgres
required modules including south
creating database for postgres

Any help appreciated on how to debug this.

settings/base.py contains

INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS

LOCAL_APPS = (
    'apps.core',
    'apps.accounts',
    'apps.project_tool',
    'apps.internal',
    'apps.external',
)

so apps.accounts exits - but it asks for AUTH_USER_MODEL = 'accounts.User' - should it be

AUTH_USER_MODEL = 'apps.accounts.User'?

Upvotes: 4

Views: 4406

Answers (3)

Joshua
Joshua

Reputation: 314

I'm aware this is an old question but I struggled with this issue for two days before finding my mistake, which was failing to follow the models organization in the Django Models docs.

If you have the AUTH_USER_MODEL = <app_name>.<user_model> correctly written, and you have your '<app_name>', in your INSTALLED_APPS list, but you're still getting this error, it's possible that your <custom_user> model (e.g. User) is in the wrong place.

It needs to be defined in either:

  • <app_name>.models.py

OR

  • <app_name>/models/<arbitrary_name>.py AND there is an <app_name>/models/__init__.py that contains the line from .<arbitrary_name> import <custom_user>

Upvotes: 1

RedRory
RedRory

Reputation: 632

Are you running South 0.8.3?

Ensure that you running South at least 0.8.4

GitHub issue South Release Notes

Upvotes: 0

Stefan K&#246;gl
Stefan K&#246;gl

Reputation: 4733

I'd assume that the accounts app hasn't been added to your INSTALLED_APPS in settings.py.

Upvotes: 2

Related Questions