0

我安装网上教程将我的本地django项目配置进阿里云centos服务器。
我的环境:
python 3、centos7、django 2.x.

这是我的错误异常:

[Wed May 22 14:50:21.328181 2019] [wsgi:error] [pid 3989:tid 140181625566976] [client 47.100.189.23:44490] mod_wsgi (pid=3989): Target WSGI script '/var/www/budbit/stockAdmin/stockAdmin/wsgi.py' cannot be loaded as Python module.
[Wed May 22 14:50:21.328272 2019] [wsgi:error] [pid 3989:tid 140181625566976] [client 47.100.189.23:44490] mod_wsgi (pid=3989): Exception occurred processing WSGI script '/var/www/budbit/stockAdmin/stockAdmin/wsgi.py'.
[Wed May 22 14:50:21.328378 2019] [wsgi:error] [pid 3989:tid 140181625566976] [client 47.100.189.23:44490] Traceback (most recent call last):
[Wed May 22 14:50:21.328422 2019] [wsgi:error] [pid 3989:tid 140181625566976] [client 47.100.189.23:44490] File "/var/www/budbit/stockAdmin/stockAdmin/wsgi.py", line 12, in <module>
[Wed May 22 14:50:21.328426 2019] [wsgi:error] [pid 3989:tid 140181625566976] [client 47.100.189.23:44490] from django.core.wsgi import get_wsgi_application
[Wed May 22 14:50:21.328446 2019] [wsgi:error] [pid 3989:tid 140181625566976] [client 47.100.189.23:44490] ModuleNotFoundError: No module named 'django'

这是我的httpd.conf:
LoadModule wsgi_module modules/mod_wsgi.so

WSGIPythonHome /usr/local/python3/bin/python3

WSGIPythonPath /var/www/budbit/stockAdmin

<VirtualHost *:80>

DocumentRoot  "/var/www/budbit/stockAdmin"
WSGIScriptAlias  / "/var/www/budbit/stockAdmin/stockAdmin/wsgi.py"
<Directory  /var/www/budbit/stockAdmin/static>
    Require all granted
</Directory>
<Directory  /var/www/budbit/stockAdmin>
    AllowOverride all
    Require all granted
</Directory>

</VirtualHost>

问题描述

问题出现的环境背景及自己尝试过哪些方法

相关代码

// 请把代码文本粘贴到下方(请勿用图片代替代码)

你期待的结果是什么?实际看到的错误信息又是什么?

2019-05-22 提问
1 个回答
0

很明显的环境配置有问题

撰写答案

推广链接