django notes 5 urlconfig
来源:互联网 发布:d3.js 地图热力图 编辑:程序博客网 时间:2024/04/29 06:12
first import urs ,include patterns (匹配正则)
from django.conf.urls.defaults import patterns,include,url
1.
url(r'^blog/index/$','blog/views/index')
2.
from blog.views import indexurl(r'^blog/index/$',index)
3.
from blog.views import indexurl(r'^blog/index/$',index)
-------------------------------------------------
url pass the arguments
url(r'^blog/index/(?P<id>\d{2})/$','index')
then in the views function define way:
def index(req,id) render_to_response('index.html',{'id':id})
rember the P<id> should be equals with the function 'index()' secend argument
0 0
- django notes 5 urlconfig
- Django study notes
- django notes 1
- django notes 2
- my django notes
- django notes 3 Template variables
- django notes 4 template tags and filters
- BackTrack 5 notes
- Java Notes-5
- Java Notes-5
- Python Notes (5)
- Notes
- notes
- Notes
- notes
- notes
- notes
- notes
- 黑马程序员_SQL SERVER 学习笔记.约束
- 自然对齐:sizeof struct, union
- js实现网页自动刷新
- Lua学习与交流——Lua os.date 和 os.time 分享
- Dependency injection and inversion of control
- django notes 5 urlconfig
- DirectX 9.0 (5) 点光源
- CNN Features off-the-shelf: an Astounding Baseline for Recognition
- 常见浏览器兼容性问题与解决方案
- 归并排序的一种c++实现
- 第2章 算法分析
- JSON学习
- MapReduce大数据处理技术课程复习提纲
- 新时代水王