我最近将我的 django 应用程序部署到了我的 Linux CPanel 共享主机。
在开发中测试一切运行良好,但在部署后不久,每次用户尝试导航到 URL(包括内置的 Django 管理面板)时,我的应用程序都会显示 404 Not Found
页面。
这是我的部署网站:https://covid19.africansurveyors.net
我联系了我的托管服务提供商,以检查问题可能出在哪里,但不幸的是,由于他们提到了代码错误,因此没有解决。因此,我将我的应用程序带到 Heroku 并进行了部署。
仍然是同一个应用程序的 Heroku 应用程序的 URL 是:https://covid19zwe.herokuapp.com/。 该应用程序在 Heroku 上运行良好,但在 CPanel 共享托管上无法正常运行。
我还检查了我的服务器日志文件的 --tail
这就是出现的问题。
App 2247037 output: wsgi = imp.load_source('wsgi', 'passenger_wsgi.py')
App 2247037 output: File "/home/<my_username>/virtualenv/public_html/covid19.africansurveyors.net/3.7/lib64/python3.7/imp.py", line 169, in load_source
App 2247037 output:
App 2247037 output: module = _exec(spec, sys.modules[name])
App 2247037 output: File "<frozen importlib._bootstrap>", line 623, in _exec
App 2247037 output: File "<frozen importlib._bootstrap>", line 568, in _init_module_attrs
App 2247037 output: File "<frozen importlib._bootstrap>", line 409, in cached
App 2247037 output: File "<frozen importlib._bootstrap_external>", line 372, in _get_cached
App 2247037 output: File "<frozen importlib._bootstrap_external>", line 296, in cache_from_source
App 2247037 output: RecursionError
App 2247037 output: : maximum recursion depth exceeded while calling a Python object
App 2388434 output: /opt/passenger-5.3.7-9.el6.cloudlinux/src/helper-scripts/wsgi-loader.py:26: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
App 2388434 output: import sys, os, io, re, imp, threading, signal, traceback, socket, select, struct, logging, errno
App 436449 output: /opt/passenger-5.3.7-9.el6.cloudlinux/src/helper-scripts/wsgi-loader.py:26: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
App 436449 output: import sys, os, io, re, imp, threading, signal, traceback, socket, select, struct, logging, errno
App 439960 output: /opt/passenger-5.3.7-9.el6.cloudlinux/src/helper-scripts/wsgi-loader.py:26: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
App 439960 output: import sys, os, io, re, imp, threading, signal, traceback, socket, select, struct, logging, errno
我也在 passenger_wsgi.py
文件中以这种方式配置了 WSGI
import os
import sys
from covid.wsgi import application
我的应用名称在哪里 covid
我不确定到底发生了什么。如果有人可以提供帮助,我将不胜感激。