urls.py Regular Expressions

rusli
Site Admin
文章: 212
註冊時間: 週三 7月 07, 2010 9:49 pm

urls.py Regular Expressions

文章rusli » 週六 8月 23, 2014 7:18 pm

^ Denotes start of string
$ Denotes end of string

r'^hello$'
The "r" before the first quote means "raw string" notation


To match any URL starting with "prefix/"
r'^prefix/.*$'

more about python regex: http://goo.gl/5uJsfy

回到「Django」

誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 1 位訪客