I am new in django. I try to practice and run the wiki application (i found tutorial at http://showmedo.com/videotutorials/video?name=1100000&fromSeriesID=110">Learn django), In url.py file i write the following urls...
urlpatterns = patterns('',
(r'^wikicamp/(?p<page_name>[^/]+)/edit/$','wikiapp.wiki.views.edit_page'),
(r'^wikicamp/(?p<page_name>[^/]+)/save/$','wikiapp.wiki.views.save_page'),
(r'^wikicamp/(?p<page_name>[^/]+)/$','wikiapp.wiki.views.view_page'),
)
But there is errror which i cant understand.
sre_Constants.error:Unexpected end of pattern.
(r'^wiki开发者_开发知识库camp/(?p<page_name>[^/]+)/$','wikiapp.wiki.views.view_page'),
I use the Django-1.0.2-final.tar.gz
You need to use an uppercase P
to capture named regexp groups:
urlpatterns = patterns('',
(r'^wikicamp/(?P<page_name>[^/]+)/edit/$','wikiapp.wiki.views.edit_page'),
(r'^wikicamp/(?P<page_name>[^/]+)/save/$','wikiapp.wiki.views.save_page'),
(r'^wikicamp/(?P<page_name>[^/]+)/$','wikiapp.wiki.views.view_page'),
)
精彩评论