错误运行WSGI应用Pythonanywhere鹡鸰应用

问题描述 投票:0回答:1

我遇到这个问题上pythonanywhere在我的网页不会被渲染。我怀疑这是一些与DJANGO_SETTINGS_MODULE,但我似乎无法得到它的工作。

还试图用“鹡鸰 - Onepage-Portfolio.settings”,但也不能工作。

import os
import sys

path = '/home/webconexus/portfolio/portfolio/Wagtail-Onepage-Portfolio'
if path not in sys.path:
sys.path.append(path)

os.environ['DJANGO_SETTINGS_MODULE'] = 'portfolio.settings'

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

这是/var/www/www_rafrasenberg_nl_wsgi.py

Error running WSGI application
2019-02-06 14:58:00,884: django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.
2019-02-06 14:58:00,884:   File "/var/www/www_rafrasenberg_nl_wsgi.py", line 12, in <module>
2019-02-06 14:58:00,884:     application = get_wsgi_application()
2019-02-06 14:58:00,884: 
2019-02-06 14:58:00,884:   File "/home/webconexus/portfolio/lib/python3.7/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
2019-02-06 14:58:00,884:     django.setup(set_prefix=False)
2019-02-06 14:58:00,884: 
2019-02-06 14:58:00,885:   File "/home/webconexus/portfolio/lib/python3.7/site-packages/django/__init__.py", line 19, in setup
2019-02-06 14:58:00,885:     configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
2019-02-06 14:58:00,885: 
2019-02-06 14:58:00,885:   File "/home/webconexus/portfolio/lib/python3.7/site-packages/django/conf/__init__.py", line 57, in __getattr__
2019-02-06 14:58:00,885:     self._setup(name)
2019-02-06 14:58:00,885: 
2019-02-06 14:58:00,885:   File "/home/webconexus/portfolio/lib/python3.7/site-packages/django/conf/__init__.py", line 44, in _setup
2019-02-06 14:58:00,885:     self._wrapped = Settings(settings_module)
2019-02-06 14:58:00,885: 
2019-02-06 14:58:00,886:   File "/home/webconexus/portfolio/lib/python3.7/site-packages/django/conf/__init__.py", line 126, in __init__
2019-02-06 14:58:00,886:     raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
2019-02-06 14:58:00,886: ***************************************************
2019-02-06 14:58:00,886: If you're seeing an import error and don't know why,
2019-02-06 14:58:00,886: we have a dedicated help page to help you debug: 
2019-02-06 14:58:00,886: https://help.pythonanywhere.com/pages/DebuggingImportError/
2019-02-06 14:58:00,886: ***************************************************
python django wsgi pythonanywhere
1个回答
2
投票

该错误信息是很清楚的给我。你SECRET_KEY场(在应用程序的settings.py文件)是空的。您需要提供该设置(Django将不会启动没有它)的值。见the docs更多。

© www.soinside.com 2019 - 2024. All rights reserved.