I have a simple url that doesn’t match into one of my applications (plaq)
main url.py:
urlpatterns = patterns('',
#...
url(r'^content/', include('content.urls')),
url(r'^$', include('content.urls')),
url(r'^plaq/', include('plaq.urls')),
#...
)
plaq url.py:
urlpatterns = patterns('',
(r'^$', pres),
(r'pres^$', pres),
(r'about^$', about),
(r'privacy^$', privacy),
)
Trying to access to my_host/plaq/pres gives me
Using the URLconf defined in my_project.urls, Django tried these URL patterns, in this order:
…
12. ^content/
13. ^plaq/ ^$
14. ^plaq/ pres^$
15. ^plaq/ about^$
16. ^plaq/ privacy^$
…
The current URL, plaq/pres/, didn’t match any of these.
While my_host/plaq displays the good pres view
Why can’t I access to my_host/plaq/pres ?
Firstly, you need to learn a bit about regexes:
^means beginning of string, but for some reason you have it at the end.Secondly, your URLs end in slashes, so your urlconfs must too.