I have a Django project I am working on, I have just realised that certain URLs are rejected by the server with the error:
NoReverseMatch: Reverse for 'mapView' with arguments '(u'intranet.hieta.biz',)' and keyword arguments '{}' not found. 1 pattern(s) tried: [u'QMSv2/(?P[\w-]+)/$']
The weird thing I dont get about this that half of the pages work and are reachable but the others arent. They all share the same format, database, view, url, template.. I cannot spot a difference. This is the url it is trying to match it to:
url(r'^(?P[\w-]+)/$', views.mapView, name="mapView")
If anyone has any idea of what might cause Django to reject certain slugs and not others then please let me know any help is immensely appreciated!!
Note: All pages are rendered with the same template, url and view. The slugs are all in the same database and the slugs themselves are all generated from the same function.
Your group [\w-]+
matches A-Z, a-z, 0-9, underscores and hyphens, but does not match periods .
. You should change it to:
[\w.-]+