There are three files in my settings folder:
I've put this line in my wsgi.py file:
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myproj.settings.development")
But when I run gunicorn myproj.wsgi:application
and try to load application in browser I get:
ImproperlyConfigured: The SECRET_KEY setting must not be empty.
I definitely have SECRET_KEY
in base.py
and in development.py
I have this line:
from base import *
I've updated manage.py
and specified new settings file there just to test if runserver
will work and it works.
UPDATE:
And now I have put SECRET_KEY
into development.py
. When I run gunicorn myproj.wsgi:application --settings 'myproj.settings.development'
the error is still there.
Just needed to run :
gunicorn myproj.wsgi:application --env DJANGO_SETTINGS_MODULE='myproj.settings.development'
There's a line
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "videotube.settings.development")
in my wsgi.py. I don't know why but gunicorn doesn't care about it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With