在本地主机Windows中运行Django + Apache

时间:2019-03-07 03:07:15

标签: python django

我想尝试使用apache作为django的服务器,我已经在底部的httpd.conf中添加了这样的代码

WSGIScriptAlias / /D:/CodeTesting/Django/project1/project1/wsgi.py
WSGIPythonHome /C:/Users/Fatoni/Envs/django
WSGIPythonPath /D:/CodeTesting/Django/project1

<Directory /D:/CodeTesting/Django/project1/project1>
   <Files wsgi.py>
      Require all granted
   </Files>
</Directory>

注意:我已经将documentroot apache更改为d:/,并且在开发中使用了virtualenv,也通过xampp使用了apache。

我在该配置中犯了一个错误,我应该怎么做才能在apache中本地运行django?

在添加该代码后,它显示出这样的错误

10:06:05  [Apache]  Status change detected: running
10:06:07  [Apache]  Status change detected: stopped
10:06:07  [Apache]  Error: Apache shutdown unexpectedly.
10:06:07  [Apache]  This may be due to a blocked port, missing dependencies, 
10:06:07  [Apache]  improper privileges, a crash, or a shutdown by another method.
10:06:07  [Apache]  Press the Logs button to view error logs and check
10:06:07  [Apache]  the Windows Event Viewer for more clues
10:06:07  [Apache]  If you need more help, copy and post this
10:06:07  [Apache]  entire log window on the forums

0 个答案:

没有答案