跟着上一篇的笔记
做一个helloworld 页面~~
cd /usr/local/python_web/www
vi test.py
内容为
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello, world")
------
修改 urls.py
urlpatterns = patterns('',
# Example:
# (r'^www/', include('www.foo.urls')),
(r'^$', 'www.test.index'),
# Uncomment the admin/doc line below to enable admin documentation:
# (r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
# (r'^admin/', include(admin.site.urls)),
)
----------
打开浏览器输入 http://xx.com (我配了host的,指向自己的服务器)
怎么还是这个页面:(
尝试了很多次
最后把uwsgi 重启
killall -9 uwsgi
/usr/local/uwsgi/bin/uwsgi -x /usr/local/uwsgi/conf/uwsgi.xml
然后刷新页面
结果成功了
结论:
太坑爹了吧? 写个helloworld页面,要把uwsgi服务器重启才生效,还要修改django配置
----