I'm step by step switching my django project to work on local from vagrant to docker.
With docker, you don't need a virtualenv. Even if I find it very convenient I'm facing some new troublesome issues.
The main one is this error on ./manage.py cmd:
ImportError: Could not import settings '"config"' (Is it on sys.path? Is there an import error in the settings file?): No module named '"config"'
So when I start the python console code and type:
>> import sys
>> sys.path
>> ['', '/usr/lib/python3.4', '/usr/lib/python3.4/plat-x86_64-linux-gnu', '/usr/lib/python3.4/lib-dynload', '/usr/local/lib/python3.4/dist-packages', '/usr/lib/python3/dist-packages']
But my path project is:
/var/www/webapps/wrapper_website/app
I've a setup environment loaded on docker-compose up which contain:
DJANGO_CONFIGURATION="LocalContent"
And that's what I'm trying to reach.
The config folder is in:
/var/www/webapps/wrapper_website/app/config
I've tried this in the wsgi.py:
import os
import sys
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config")
os.environ.setdefault("DJANGO_CONFIGURATION", "Production")
sys.path.insert(0,
os.path.abspath(os.path.dirname(os.path.dirname(__file__)))) <- this line
from configurations.wsgi import get_wsgi_application
application = get_wsgi_application()
Without success.