Python Django Apache配置

Savorboard發表於2014-08-18

專案結構目錄:

 

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',
)

相關文章