Pythonywhere:错误代码:未处理的异常

2024-10-01 09:21:25 发布

您现在位置:Python中文网/ 问答频道 /正文

大家好。尝试使用Python部署django站点时,出现错误:

enter image description here

这里是我的WSGI配置文件:/var/www/cargoglobal\u pythonanwhere\u com\u 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()

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


Tags: pathdjangofrompyimportcomwsgiget