标签:reg ima htm 关系 字符 UI min render direct
1.浏览器客户端请求首先到达项目名文件夹下的urls.py
urlpatterns = [ url(r‘^app1/‘, include("app1.urls")), url(r‘^app2/‘, include("app2.urls")), ]
2.经过路由分发会到app下的urls.py
urlpatterns = [ url(r‘^admin/‘, admin.site.urls), url(r‘^read/‘, views.read), url(r‘^login‘, views.login), url(r‘^orm‘, views.orm), url(r‘^home‘, views.home), url(r‘^register‘, views.Register.as_view()), url(r‘^father‘, views.father), url(r‘^child‘, views.child), url(r‘^tpl‘, views.tpl), url(r‘^user_list‘, views.user_list), url(r‘^aaa-(?P<uid>\d+)-(?P<pid>\d+).html‘, views.aaa), ]
3.然后到处理函数
def read(request): return HttpResponse("<h1>readding a book!!</h1>")
def read(request): return render(request,"read.html")
def read(request): return redirect("/cmdb/read")
4.处理完成返回静态HTML页面到用户浏览器显示
标签:reg ima htm 关系 字符 UI min render direct
原文地址:http://www.cnblogs.com/cq146637/p/7806208.html