Including a Django app's url.py is resulting in a 404

Posted by 828 on Stack Overflow See other posts from Stack Overflow or by 828
Published on 2010-05-26T06:58:35Z Indexed on 2010/05/26 7:01 UTC
Read the original article Hit count: 237

I have the following code in the urls.py in mysite project.

/mysite/urls.py

from django.conf.urls.defaults import *
urlpatterns = patterns('',
    (r'^gallery/$', include('mysite.gallery.urls')),
)

This results in a 404 page when I try to access a url set in gallery/urls.py.

/mysite/gallery/urls.py

from django.conf.urls.defaults import *
urlpatterns = patterns('',  
    (r'^gallery/browse/$', 'mysite.gallery.views.browse'),
    (r'^gallery/photo/$', 'mysite.gallery.views.photo'),
)

404 error

Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:
^gallery/$
The current URL, gallery/browse/, didn't match any of these.

Also, the site is hosted on a media temple (dv) server and using mod_wsgi

© Stack Overflow or respective owner

Related posts about python

Related posts about django