0

In my base urls.py file, I have these urls:

urlpatterns = patterns('',
    url(r'', include('apps.trainee.urls', namespace='trainee')),
    url(r'', include('apps.landing.urls', namespace='landing')),
    ...
    ...
    ...
    url(r'^cache/$', memcached_status, name='memcached_status'),
)

I'm taking this project over from another developer, and haven't been able to grasp my mind around what these first two urls are doing. They're both namespaced, and from the Django docs about namespacing, I haven't quite been able to figure out why my third url r'^cache/$' Doesn't work. It 404s every single time. However, when I comment the first two urls out, then it works fine. Can anyone shed some light on this situation and why it's happening? Much thanks.

1
  • Could you show the contents of urls.py from trainee and landing apps? Commented Sep 17, 2013 at 17:02

2 Answers 2

2

You might just need to move the third url to the top. One of the first 2 might be eating up any url and then raising a 404 for some reason. This happens a lot. The order of the urls is very important.

Sign up to request clarification or add additional context in comments.

Comments

1

The first two url patterns include a bunch of other url patterns. Probably in one of those includes there is a url pattern that also matches cache/. Look into the files of the includes.

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.