Django Settings Not Working Correctly
I am able to execute python manage.py migrate - it executes perfectly But when I run django-admin shell it fails giving the following errors Traceback (most recent call last):
Solution 1:
Taken from the docs:
Generally, when working on a single Django project, it’s easier to use manage.py than django-admin. If you need to switch between multiple Django settings files, use django-admin with DJANGO_SETTINGS_MODULE or the --settings command line option.
You didn't specify a --settings
module (as an argument) in the django-admin
, that's why Django complains. Do it like this: django-admin shell --settings=myproject.settings
.
Also, from the docs:
The settings module should be in Python package syntax, e.g. mysite.settings. If this isn’t provided, django-admin will use the DJANGO_SETTINGS_MODULE environment variable.
You can also do ./manage.py shell
Post a Comment for "Django Settings Not Working Correctly"