Skip to content
Browse files

Merge branch 'better_urlpattern' into upstream/better_urlpattern

  • Loading branch information...
2 parents ceace95 + 82d2c14 commit efad1d709b4c98074a097c2b87e4daa118266a7c @neoascetic committed Sep 10, 2012
Showing with 3 additions and 5 deletions.
  1. +3 −5 cms/urls.py
View
8 cms/urls.py
@@ -4,10 +4,8 @@
from django.conf import settings
from django.conf.urls.defaults import url, patterns
-if settings.APPEND_SLASH:
- reg = url(r'^(?P<slug>[0-9A-Za-z-_.//]+)/$', details, name='pages-details-by-slug')
-else:
- reg = url(r'^(?P<slug>[0-9A-Za-z-_.//]+)$', details, name='pages-details-by-slug')
+reg_re = r'(?u)^(?P<slug>[-.//\w]+)%s$' % (settings.APPEND_SLASH and '/' or '')
+reg = url(reg_re, details, name='pages-details-by-slug')
urlpatterns = [
# Public pages
@@ -23,4 +21,4 @@
urlpatterns = get_app_patterns() + urlpatterns
#urlpatterns = (dynamic_app_regex_url_resolver, ) + urlpatterns
-urlpatterns = patterns('', *urlpatterns)
+urlpatterns = patterns('', *urlpatterns)

0 comments on commit efad1d7

Please sign in to comment.
Something went wrong with that request. Please try again.