Python django中apache配置mod_wsgi

时间:2021-07-02 16:07:29   收藏:0   阅读:0

Python3.5

LoadFile "c:/python35/python35.dll"
LoadModule wsgi_module "c:/python35/lib/site-packages/mod_wsgi/server/mod_wsgi.cp35-win_amd64.pyd"
WSGIPythonHome "c:/python35"


#设置工程中的wsgi路径
WSGIScriptAlias / D:/django-apache/demo/demo/wsgi.py
#设置工程路径
WSGIPythonPath "D:/django-apache/demo"
#设置wsgi路径
<Directory D:/django-apache/demo/demo>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
#设置静态文件路径
Alias /media/ D:/django-apache/demo/static/
<Directory D:/django-apache/demo/static>
Require all granted
</Directory>

#设置静态文件路径
Alias /static/ D:/django-apache/demo/static/
<Directory D:/django-apache/demo/static>
Require all granted
</Directory>

WSGIApplicationGroup %{GLOBAL}

 

Python3.7

LoadFile "C:/Python37/python37.dll"
LoadModule wsgi_module "D:/django-apache/venv3/lib/site-packages/mod_wsgi/server/mod_wsgi.cp37-win_amd64.pyd"
WSGIPythonHome "D:/django-apache/venv3"


#设置工程中的wsgi路径
WSGIScriptAlias / D:/django-apache/demo/demo/wsgi.py
#设置工程路径
WSGIPythonPath "D:/django-apache/demo"
#设置wsgi路径
<Directory D:/django-apache/demo/demo>
  <Files wsgi.py>
    Require all granted
  </Files>
</Directory>
#设置静态文件路径
Alias /media/ D:/django-apache/demo/static/
<Directory D:/django-apache/demo/static>   
  Require all granted  
</Directory>

#设置静态文件路径
Alias /static/ D:/django-apache/demo/static/
<Directory D:/django-apache/demo/static>   
  Require all granted  
</Directory>

WSGIApplicationGroup %{GLOBAL}

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!