Django~urls.py--->views.py
2016-03-18 16:46
483 查看
The
'r'in front of each regular expression string is optional but recommended. It tells Python that a string is “raw” – that nothing in the string should be escaped. See Dive Into Python’s explanation.
(?P<name>pattern)
urlpatterns = [ url(r'^articles/2003/$', views.special_case_2003), url(r'^articles/(?P<year>[0-9]{4})/$', views.year_archive), url(r'^articles/(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/$', views.month_archive), url(r'^articles/(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/(?P<day>[0-9]{2})/$', views.article_detail), ]
相关文章推荐
- Django~Models2
- What we learned in Seoul with AlphaGo
- Django模板简介
- 九度题目1440Goldbach's Conjecture
- go test命令参数问题
- go源码阅读笔记(math.3)
- Go计算运行的时间
- 【原创】k8s源码分析------第三方库go-restful分析
- ubuntu中安装mongo
- Django settings — Django 1.6 documentation
- Google API V3自定义图标和信息框
- Standalone Django scripts
- Django系列:(1)PyCharm下创建并运行我们的第一个Django工程
- Django 开发可以停了
- go语言的string和slice是值拷贝吗?
- 推荐一个go语言笔记
- DFP简单粗暴的笔记(About Google Native DFP)
- Django基于类的编辑视图和Mixins
- Algorithms
- 转载-Django模板系统基础