Darren
Darren

Reputation: 11011

Django Can't Find Installed App

I have my directory structure like this for my Django application:

project
    __init__.py
    settings.py
    ...
users
    __init__.py
    model.py
    ....

In my model.py I have this class:

class User():
    ...

However when I configure my INSTALLED_APPS like this:

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'south',
    'users'
    # Uncomment the next line to enable the admin:
    # 'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
)

Django cannot find the application users. What am I doing wrong?

Upvotes: 1

Views: 4548

Answers (1)

Hedde van der Heide
Hedde van der Heide

Reputation: 22449

Change model.py to models.py, or if you want to use a different name for your module append the app_label argument to your models Meta classes:

class YourModel(models.Model):
    # fields...

    class Meta:
        app_label = 'users'

Upvotes: 4

Related Questions