I have the following line in my src/urls.py
(r'^nomundo', include('interviews.urls')),
and in my src/interviews/urls.py
I have the following:
r'/$', 'interviews.views.interviews'),
This construction allows me to access URLs such as /nomundo/blablabla/trololo/foo/bar
, or any other with as many /something
as I want.
I would like these to raise a 404 error.
How can I specify my regexp to do so? Or the solution is something else?
Thank you for your time.
You forgot to root your sub-URL so that it starts at the beginning of the string.
(r'^$', 'interviews.views.interviews')
Note that you usually include the initial slash in the parent's url, which is why I haven't included it above:
(r'^nomundo/', include('interviews.urls')),