Django Step by Step (十二) 之
6 部署到 Apache 上的体验
limodou的这个Django入门果然经典,不过我学习时候在这个地方遇到了些问题及其解决:
1、访问admin的时候没有加载admin的所有/media/,按照 [Django]Windows下Django配置Apache示范设置 的提示,在Apache的配置文件里添加:
<Directory “D:/Python25/Lib/site-packages/django/contrib/admin/media”> Order Deny,Allow Allow from all </Directory>
2、访问/address/下的各个方法均得到address.views模块不存在的错误报告, 修改/address/下urls.py文件,将
(r'^upload/$', 'address.views.upload'), (r'^output/$', 'address.views.output'), (r'^search/$', 'address.views.search'),
改为:
(r'^upload/$', 'newtest.address.views.upload'), (r'^output/$', 'newtest.address.views.output'), (r'^search/$', 'newtest.address.views.search'),
这个问题比较奇怪,按道理在/newtest/下urls.py里已经include了address.urls了啊! 而且,对于上面两种urls配置,在django自带的服务器上居然都运行良好!@_@