运行manager.py shell 时报错,查网上有关帖子,在setting.py 中添加
from django.core.wsgi import get_ws gi_application
application = get_wsgi_application()
仍然报错:
raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.
估计这个错误和SECRET_KEY有关,然后把application = get_wsgi_application()移到SECRET_KEY的赋值之后。
from django.core.wsgi import get_wsgi_application
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY ='bk=5-o+^bfdga*y$s4xt48%ju&v678(he!v930^oq3siq+f+35'
application = get_wsgi_application()
Work!!!
网友评论