简体   繁体   English

运行WSGI应用程序Pythonanywhere Wagtail应用程序时出错

[英]Error running WSGI application Pythonanywhere Wagtail application

I am running into this problem on pythonanywhere where my webpage won't render. 我在无法显示我的网页的pythonanywhere上遇到了这个问题。 I suspect it is something with the DJANGO_SETTINGS_MODULE but I can't seem to get it to work. 我怀疑DJANGO_SETTINGS_MODULE有点问题,但我似乎无法使其正常工作。

Also tried to use 'Wagtail-Onepage-Portfolio.settings' but did not work either. 也尝试使用“ Wagtail-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()

This is the /var/www/www_rafrasenberg_nl_wsgi.py 这是/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: ***************************************************

The error message is pretty clear to me. 错误消息对我来说很清楚。 Your SECRET_KEY field (in your application's settings.py file) is empty. 您的SECRET_KEY字段(在应用程序的settings.py文件中)为空。 You need to provide a value for that setting (Django won't start without it). 您需要提供该设置的值(没有它,Django不会启动)。 See the docs for more. 有关更多信息,请参阅文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM