使用Apache部署django项目

时间:2018-10-23 10:09:33

标签: django apache mod-wsgi

我正在尝试使用Apache部署django项目,但出现此错误

[Tue Oct 23 11:05:27.321603 2018] [wsgi:error] [pid 11440:tid 1308] [client ::1:7844] ModuleNotFoundError: No module named 'django'\r
[Tue Oct 23 11:05:40.381358 2018] [wsgi:error] [pid 11440:tid 1304] [client ::1:7852] mod_wsgi (pid=11440): Failed to exec Python script file 'C:/wamp64/bin/apache/apache2.4.27/htdocs/project/djangoProject/djangoProject/wsgi.py'.
[Tue Oct 23 11:05:40.381358 2018] [wsgi:error] [pid 11440:tid 1304] [client ::1:7852] mod_wsgi (pid=11440): Exception occurred processing WSGI script 'C:/wamp64/bin/apache/apache2.4.27/htdocs/project/djangoProject/djangoProject/wsgi.py'.
[Tue Oct 23 11:05:40.381358 2018] [wsgi:error] [pid 11440:tid 1304] [client ::1:7852] Traceback (most recent call last):\r
[Tue Oct 23 11:05:40.381358 2018] [wsgi:error] [pid 11440:tid 1304] [client ::1:7852]   File "C:/wamp64/bin/apache/apache2.4.27/htdocs/project/djangoProject/djangoProject/wsgi.py", line 13, in <module>\r
[Tue Oct 23 11:05:40.381358 2018] [wsgi:error] [pid 11440:tid 1304] [client ::1:7852]     from django.core.wsgi import get_wsgi_application\r
[Tue Oct 23 11:05:40.381358 2018] [wsgi:error] [pid 11440:tid 1304] [client ::1:7852] ModuleNotFoundError: No module named 'django'\r

1 个答案:

答案 0 :(得分:0)

如果可以的话,我会发表评论,但我的声誉还不够高。您是否尝试过在服务器上使用pip安装django模块?您还在使用virtualenv还是整个项目系统的安装?建议您使用virtualenv,它易于设置,并且在其他开发人员的建议中也得到了广泛的支持。这是一个link的页面,它使我进入正确的路径。尽管我注意到您正在使用Windows,但您可能会从中得到一个大概的想法。