2👍
Original answer was me mistakenly thinking your sys.path
was incorrect.
New theory is that you say your settings.py lives in .../django/mysite/scr/
, so specifying mysite.settings
wouldn’t be valid.
Technically, assuming mysite
has an __init__.py
file, the path to your settings file is mysite.scr.settings
3👍
If settings.py is in /usr/local/django/mysite/scr/, then fairly obviously you should use:
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.scr.settings'
- [Django]-How install a extension in postgresql before creating the models in django?
- [Django]-Django, How to pass data object from one template to another template
- [Django]-User email from GitHub in django social login
- [Django]-Django crispy form tab
- [Django]-Show request.DATA in Django 500 error caused by Rest Framework
1👍
A couple of things you could try.
Does the test server “runserver’ work? If it doesn’t it may be that you have an error in your settings file or one of the other files it loads
The order of ‘INSTALLED APPS’ can be important. For one of my projects this error went away when I changed the order of installed apps.
The answers to this question I asked a bit ago may be helpful.
How do I stop getting ImportError: Could not import settings 'mofin.settings' when using django with wsgi?
- [Django]-How to create a new table using model
- [Django]-Prefetching unrelated model on arbitrary field equivalence
- [Django]-Django: how to map the results of a raw sql query to model instances in admin list view?
- [Django]-Django CreateView : Append ForeignKey to CustomForm Data