我到处都在寻找解决方案。我不知道怎么回事。也许我没有看到一个简单的错误或某个时候。我使用pyenv
是因为在开发过程中我使用的是python版本3.8.2和Django 3.0.5。我也有一个virtualenv设置,当我做点子冻结时,所有软件包都已安装。当我运行which django
时,什么也没有返回。我正在使用Apache 2.4和Ubuntu 18.04 LTS。提前致谢。需要任何其他信息,请告诉我。
这是配置文件:
WSGIPythonPath /etutors-site/site-dj/etutorproject
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog /etutors-site/site/logs/error.log
CustomLog /etutors-site/site/access.log combine
alias /static /etutors-site/site/public/static
<Directory /etutors-site/site/public/static>
Require all granted
</Directory>
<Directory /etutors-site/site-dj/etutorproject/etutorproject>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess etutors-site python-path=/etutors-site/site-dj/etutorproject python-home=/etutors-site/venv
WSGIProcessGroup etutors-site
WSGIScriptAlias / /etutors-site/site-dj/etutorproject/etutorproject/wsgi.py
</VirtualHost>
这是确切的错误:
[Fri May 15 21:12:27.762544 2020] [wsgi:error] [pid 9063:tid 140656260556544] [remote 72.51.112.97:22446] mod_wsgi (pid=9063): Target WSGI script '/etutors-site/site-dj/etutorproject/etutorproject/wsgi.py' cannot be loaded as Python module.
[Fri May 15 21:12:27.762661 2020] [wsgi:error] [pid 9063:tid 140656260556544] [remote 72.51.112.97:22446] mod_wsgi (pid=9063): Exception occurred processing WSGI script '/etutors-site/site-dj/etutorproject/etutorproject/wsgi.py'.
[Fri May 15 21:12:27.762899 2020] [wsgi:error] [pid 9063:tid 140656260556544] [remote 72.51.112.97:22446] Traceback (most recent call last):
[Fri May 15 21:12:27.762931 2020] [wsgi:error] [pid 9063:tid 140656260556544] [remote 72.51.112.97:22446] File "/etutors-site/site-dj/etutorproject/etutorproject/wsgi.py", line 12, in <module>
[Fri May 15 21:12:27.762940 2020] [wsgi:error] [pid 9063:tid 140656260556544] [remote 72.51.112.97:22446] from django.core.wsgi import get_wsgi_application
[Fri May 15 21:12:27.762961 2020] [wsgi:error] [pid 9063:tid 140656260556544] [remote 72.51.112.97:22446] ModuleNotFoundError: No module named 'django'
[Fri May 15 21:12:28.281276 2020] [wsgi:error] [pid 9063:tid 140656294127360] [remote 72.51.112.97:21820] mod_wsgi (pid=9063): Target WSGI script '/etutors-site/site-dj/etutorproject/etutorproject/wsgi.py' cannot be loaded as Python module.
[Fri May 15 21:12:28.281420 2020] [wsgi:error] [pid 9063:tid 140656294127360] [remote 72.51.112.97:21820] mod_wsgi (pid=9063): Exception occurred processing WSGI script '/etutors-site/site-dj/etutorproject/etutorproject/wsgi.py'.
[Fri May 15 21:12:28.281587 2020] [wsgi:error] [pid 9063:tid 140656294127360] [remote 72.51.112.97:21820] Traceback (most recent call last):
[Fri May 15 21:12:28.281652 2020] [wsgi:error] [pid 9063:tid 140656294127360] [remote 72.51.112.97:21820] File "/etutors-site/site-dj/etutorproject/etutorproject/wsgi.py", line 12, in <module>
[Fri May 15 21:12:28.281669 2020] [wsgi:error] [pid 9063:tid 140656294127360] [remote 72.51.112.97:21820] from django.core.wsgi import get_wsgi_application
[Fri May 15 21:12:28.281710 2020] [wsgi:error] [pid 9063:tid 140656294127360] [remote 72.51.112.97:21820] ModuleNotFoundError: No module named 'django'