Skip to content

Commit

Permalink
Merge pull request #20 from adamfeldman/patch-1
Browse files Browse the repository at this point in the history
Fix urlpatterns to no longer use deprecated patterns() syntax
  • Loading branch information
paltman committed Oct 20, 2017
2 parents 06c65bf + ee7a49f commit a3bf28a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pinax/wiki/urls.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import os

from django.conf.urls import patterns, url
from django.conf.urls import url

from .conf import settings
from .views import index, page, edit, file_download, file_upload

urlpatterns = patterns(
"",
urlpatterns = [
url(r"^file-download/(\d+)/([^/]+)$", file_download, name="pinax_wiki_file_download"),
url(r"^file-upload/$", file_upload, name="pinax_wiki_file_upload")
)
]

for binder in settings.PINAX_WIKI_BINDERS:
urlpatterns += patterns(
"",
urlpatterns += [
url(os.path.join(binder.root, r"$"), index, {"binder": binder}, name=binder.index_url_name),
url(os.path.join(binder.root, r"(?P<slug>[^/]+)/$"), page, {"binder": binder}, name=binder.page_url_name),
url(os.path.join(binder.root, r"(?P<slug>[^/]+)/edit/$"), edit, {"binder": binder}, name=binder.edit_url_name),
)
]

0 comments on commit a3bf28a

Please sign in to comment.