I’ve been working with django for a short time and I’m new at it. I’ve encountered a problem with the urls.py file – here is the code:
url(r'^(?P<city>\w+)/(?P<main_type>\w+)/(?P<sub_type>\w+)/(?P<post_title_slug>\w+)$', 'postpage'),
When I redirect (for example) to website.com/Paris/Art/Graphics/Test-title-for-slug
It won’t work – Page not found appears. What am I doing wrong?
I’m using: Django 1.4.1
Thanks for your help but I solved it – Here is the solution:
The post_title_slug was badly formatted so instead of
(?P<post_title_slug>\w+)I used this(?P<post_title_slug>[-\w]+)Thanks again, hope this will help someone.