Closed jcpmmx closed 9 years ago
Yeah, that worked for me too. That's a really picky bug.
@kennethlove Glad it helped you.
Fixed for me as well!
This can be closed.
Why was this closed? Shouldn't it at least be documented in the README?
Why would DJANGO_SETTINGS_MODULE
not be set? How are you launching Django?
Not sure right now TBH.
But I remember debugging that and getting the error, and solving it by having DJANGO_SETTINGS_MODULE
move up before Cling.
Why would
DJANGO_SETTINGS_MODULE
not be set?
@kennethreitz It wouldn't be set unless you set the environmental variable. Often this is unnecessary which is why the default wsgi.py created by startproject
sets a default:
"""
WSGI config for mysite project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
application = get_wsgi_application()
I was having this error when trying to deploy a Django app to Heroku (following their tutorial). This also happens when running
foreman start
locally.The solution? Setting the
DJANGO_SETTINGS_MODULE
before importing and calling Cling.