Я сталкиваюсь с этой проблемой на pythonany, где моя веб-страница не будет отображаться.Я подозреваю, что это что-то с DJANGO_SETTINGS_MODULE, но я не могу заставить его работать.
Также пытался использовать '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()
Это /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: ***************************************************