On Fri, 2006-08-11 at 02:12 -0700, Tomas Jacobsen wrote: > Malcolm Tredinnick wrote: > > > Since the first part of the URL mapping tuple is a Python regular > > expression, you can experiment at the command line. Import the "re" > > module and use the regular expression you are trying to get working to > > match against the sorts of URLs you are going to be sending in. > > Something like: > > > > >>> import re > > >>> p = > > re.compile(r'^portfolio/(?P<category_slug>[-\w]+)/(?P<project_slug>[-\w]+)$') > > >>> s = 'portfolio/foo/blah/' > > >>> m = p.match(s) > > > > At this point, m will either be None (it did not match) or a reg-exp > > match object (see the Python docs for the re module for details) that > > you can poke about at to see what made it into various keyword > > arguments, etc. > > > > The fact that you are seeing a 404 means that the regular expression is > > not picking up your URLs, so you need to start there. > > > > Regards, > > Malcolm > > The command line your talking about, is it the shell?
Yes. > I've tried python manage.py shell and the code you wrote. But nothing > happends when I type them in. No errors either. Do I need to replace > 'portfolio/foo/blah/' with a "real" url ? Yes. Replace it with the sort of URL you are sending to your app. Obviously the host name portion if stripped from the URL, but you already have a couple of working URL patterns in that file, so you can see how much to strip off the front. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---