Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix urlpatterns to no longer use deprecated patterns() syntax #20

Merged
merged 1 commit into from
Oct 20, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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),
)
]