问题描述
我正在尝试从本地环境迁移托管上的 Python Django Web 应用程序。安装进行得很顺利,但最后我在 staging.changerz.education 中没有看到 Django 的起始页面。在日志中,我发现了错误,但不确定我需要在我的应用程序中修复什么问题。请帮助任何人:
"error" : {
"category" : "INTERNAL_ERROR","id" : "23a01cfb","problem_description_html" : "<p>The Phusion Passenger application server tried to start the web application. But the application itself (and not Passenger) encountered an internal error.</p><p>The stdout/stderr output of the subprocess so far is:</p><pre>Traceback (most recent call last):\n File "/usr/share/passenger/helper-scripts/wsgi-loader.py",line 369,in <module>\n app_module = load_app()\n File "/usr/share/passenger/helper-scripts/wsgi-loader.py",line 76,in load_app\n return imp.load_source('passenger_wsgi',startup_file)\n File "/var/www/u1115154/data/www/staging.changerz.education/passenger_wsgi.py",line 6,in <module>\n from django.core.wsgi import get_wsgi_application\n File "/var/www/u1115154/data/djangoenv/lib/python3.7/site-packages/django/__init__.py",line 1,in <module>\n from django.utils.version import get_version\n File "/var/www/u1115154/data/djangoenv/lib/python3.7/site-packages/django/utils/version.py",line 71,in <module>\n @functools.lru_cache()\nAttributeError: 'module' object has no attribute 'lru_cache'\n</pre>","solution_description_html" : "<p class=\"sole-solution\">Unfortunately,Passenger does not kNow how to solve this problem. Please try troubleshooting the problem by studying the <strong>error message</strong> and the <strong>diagnostics</strong> reports. You can also consult <a href=\"https://www.phusionpassenger.com/support\">the Passenger support resources</a> for help.</p>","summary" : "The application process exited prematurely."
},
解决方法
刚刚发现 Python 版本与我在虚拟环境中的版本不同,因此值得在托管服务提供商方面检查 Python 版本。