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',
开发者_如何学JAVA'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'teachline.courses',
'teachline.grading',
)
Why isn't this working?
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.
Do you have a directory which contains teachline in your PYTHONPATH environment variable? It may be necessary to export PYTHONPATH="." to make things work.
Does the file teachline/grading/__init__.py file exist in the pythonpath.
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',
)
加载中,请稍侯......
精彩评论