首页 > 解决方案 > pythonanywhere:错误代码:未处理的异常

问题描述

嗨伙计们。当尝试使用 pythonanywhere 部署我的 django 站点时,我收到一个错误:

在此处输入图像描述

这里是我的 WSGI 配置文件:/var/www/cargoglobal_pythonanywhere_com_wsgi.py:

import os
import sys

path = '/home/cargoglobal/CargoGlobal.net'
if path not in sys.path:
    sys.path.append(path)

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

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

这里是我的项目 wsgi.py:

"""
WSGI config for elansayti 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/3.0/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'elansayti.settings')

application = get_wsgi_application()

请帮帮我,我是一个非常无助的人。

标签: pythondjango

解决方案


推荐阅读