Reputation: 1368
When I run python ./manage.py sql grading
my django site comes up with:
Error: App with label grading could not be found. Are you sure you INSTALLED_APPS setting is correct?
I have the app grading with __init__.py and everything, and my INSTALLED APPS is:
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'teachline.courses',
'teachline.grading',
)
Why isn't this working?
Upvotes: 1
Views: 4819
Reputation: 1
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'teachline.courses',
'teachline.grading',
)
Try to add just 'grading'
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'courses',
'grading',
)
Upvotes: 0
Reputation: 87077
Does the file teachline/grading/__init__.py
file exist in the pythonpath.
Upvotes: 0
Reputation: 1368
Okay, I found what was going wrong. I ran python manage.py shell
and tried to import teachline.grading.models
. It turned out I had some problems with importing modules. I fixed those and now python manage.py sql grading
works fine.
Upvotes: 2
Reputation: 7098
Do you have a directory which contains teachline
in your PYTHONPATH
environment variable? It may be necessary to export PYTHONPATH="."
to make things work.
Upvotes: 0