views:

80

answers:

1

I'm working with Django, admittedly for the first time doing anything real.

The URL config looks like the following:

urlpatterns = patterns('my_site.core_prototype.views',

    (r'^newpost/$', 'newPost'),

    (r'^$', 'NewPostAndDisplayList'), # capture nothing...


    #more here... - perhaps the perma-links?
)

This is in an app's url.py which is loaded from the project's url.py via:

urlpatterns = patterns('',
    # only app for now.
    (r'^$', include('my_site.core_prototype.urls')),
)

The problem is, when I receive a 404 attempting to utilize newpost, the error page only shows the ^$ -- it seems to ignore the newpost pattern...

I'm sure the solution is probably stupid-simple but right now I'm missing it. Can someone help get me on the right track...

+1  A: 

Your pattern for the include will only match an empty URL string, change it to a prefix which should be mapped to the included urls, or remove the $ from that pattern.

protobuf
Got it. I removed the `$` from the project's url.py and it worked as it should. Thank you.
Frank V
Don't forget to mark the answer as accepted.
Daniel Roseman
How could I? That'd affect my 95% some accept rate...
Frank V