作者left (881 forever)
看板Python
标题Re: How to use Django with Apache and mod_wsgi
时间Wed Sep 10 11:43:49 2014
※ 引述《left (881 forever)》之铭言:
※ 引述《left (881 forever)》之铭言:
请问一下 如果我要在apache上用django到底要怎麽用啊
弄了好几天都不得其门而入
apache 还有mod_wsgi都装了啊
我照着下面官网说的指示做
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/modwsgi/
右边是我放wsgi.py的地方(内建)C:/Users/mango/Desktop/deploy_test/mysite/mysite
WSGIScriptAlias / C:/Users/mango/Desktop/deploy_test/mysite/mysite/wsgi.py
WSGIPythonPath C:/Users/mango/Desktop/deploy_test/mysite/mysite
<Directory C:/Users/mango/Desktop/deploy_test/mysite/mysite>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>
我的目标是Django 内建的admin这个网只要能进去
现在是有哪些眉角没注意到吗?
希望各位大大教一下
网址输入
http://localhost/admin
403 error
Forbidden
You don't have permission to access /admin on this server
--
sorry眼残
已经照uranusjr大大改了
放wsgi.py的地方(内建)C:/Users/mango/Desktop/deploy_test/mysite/mysite
更改如下:
WSGIScriptAlias / C:/Users/mango/Desktop/deploy_test/mysite/mysite/wsgi.py
WSGIPythonPath C:/Users/mango/Desktop/deploy_test/mysite
<Directory C:/Users/mango/Desktop/deploy_test/mysite/mysite>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>
现在的error message变成
Bad Request (400)
------
继续照着uranusjr大的指示
目前已经可以把admin挂上去了
可是有点奇怪的是 原先django admin的一些板膜javascript好像都不见了
如下面网址
http://140.112.29.187/admin/
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 140.112.218.124
※ 文章网址: http://webptt.com/cn.aspx?n=bbs/Python/M.1410164587.A.F14.html
1F:→ uranusjr: 最明显的问题是 WSGIPythonPath 要出来一层 09/08 17:21
2F:→ uranusjr: 然後请附上 error log 谢谢 09/08 17:21
※ 编辑: left (140.112.218.124), 09/08/2014 17:41:30
3F:→ left: 已经附上error message搂~~ 09/08 17:42
4F:→ left: uranusjr 出来一层的意思是? 09/08 17:43
--
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 140.112.218.124
※ 文章网址: http://webptt.com/cn.aspx?n=bbs/Python/M.1410171453.A.911.html
5F:→ uranusjr: 你有改 ALLOWED_HOSTS 吗? 09/08 20:40
--
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 140.112.218.124
※ 文章网址: http://webptt.com/cn.aspx?n=bbs/Python/M.1410320632.A.651.html