我读了很多文章,但仍然不知道我错过了什么。我正在从 virtualenv 运行一个 django 网站。这是我的配置文件。网站地址已替换为<domain.com>,此处无法使用。
配置
<VirtualHost *:80>
ServerAdmin sidharth@collaboration-management
ServerName <domain.com>
ServerAlias <domain.com>
DocumentRoot /home/sidharth/Downloads/gmcweb
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /static /home/sidharth/Downloads/gmcweb/static
<Directory /home/sidharth/Downloads/gmcweb/static>
Require all granted
</Directory>
<Directory /home/sidharth/Downloads/gmcweb/gmcweb>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess gmcweb python-home=/home/sidharth/Downloads/gmcwebenvlin python-path=/home/sidharth/Downloads/gmcweb
WSGIProcessGroup gmcweb
WSGIScriptAlias / /home/sidharth/Downloads/gmcweb/gmcweb/wsgi.py
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
这是我的 WSGI.py 文件,没有更改任何以前不需要的内容
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'gmcweb.settings')
application = get_wsgi_application()
Run Code Online (Sandbox Code Playgroud)
Python 版本
我的 virtualenv python 版本是 3.9.5 默认 Google VM python 版本是 3.6.9
Python 安装的库
Package Version …Run Code Online (Sandbox Code Playgroud)