Reputation: 11011
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
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