0

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'^wikicamp/(?p<page_name>[^/]+)/$','wikiapp.wiki.views.view_page'), 

I use the Django-1.0.2-final.tar.gz

1 Answer 1

6

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'),
)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.