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}