url-pattern

urlpattern Regex is not working as expected

urlpattern Regex is not working as expected Question: I have a Django website and for the times that pages are not ready I want to redirect any URL to a specific maintenance page. So in the urlpatterns of my website I added this regex expecting it to capture anything after / but it’s not working. …

Total answers: 1

Django, name parameter in urlpatterns

Django, name parameter in urlpatterns Question: I’m following a tutorial where my urlpatterns are: urlpatterns = patterns(”, url(r’^passwords/$’, PasswordListView.as_view(), name=’passwords_api_root’), url(r’^passwords/(?P<id>[0-9]+)$’, PasswordInstanceView.as_view(), name=’passwords_api_instance’), …other urls here…, ) The PasswordListView and PasswordInstanceView are supposed to be class based views. I could not figure out the meaning of the name parameter. Is it a default parameter passed …

Total answers: 1