首页 > 代码库 > Python Django Apache配置

Python Django Apache配置

项目结构目录:

 

Apache 安装配置目录: C:\Apache2.2\conf\httpd.conf

LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias / D:\TestApp\MyDjangoSite\mysite\mysite\wsgi.py
<FilesMatch "D:/TestApp/MyDjangoSite/mysite">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>
Alias /static D:\TestApp\MyDjangoSite\mysite\app\static
<Directory D:/TestApp/MyDjangoSite/mysite/app/static>
Order deny,allow
Allow from all
</Directory>

 

其中WSGI文件 D:\TestApp\MyDjangoSite\mysite\mysite\wsgi.py 中需要添加Path目录

 

其中当指定settings.py中DEBUG = True时候

需要再指定

ALLOWED_HOSTS = (
‘*‘,‘localhost‘,
)