django-authority/example/urls.py
Jason Ward a868d54945 Add support for Django 1.11 (#58)
* refs #1: Updated tox + travis.

* refs #1; Fixed path to register.

* refs #1: Updated urls.py

* refs #1: Added username field. Not really sure why it was needed, but whatever.

* Added an update note.

* refs #2: Updated travis.

* refs #2: Updated command to run tests.

* refs #2: Added a test showing permission_required is busted.

* refs #2: Custom user modal needs a default manager.

* refs #2: Updated settings.

* refs #2: Stop the exception from being raised.

* refs #2: Fixed a problem with named parameters.
2018-01-19 17:37:15 +06:00

42 lines
1.3 KiB
Python

import django.contrib.auth.views
from django.conf.urls import include, handler500, url
from django.conf import settings
import authority.views
import authority.urls
import example.exampleapp.views
from exampleapp.forms import SpecialUserPermissionForm
authority.autodiscover()
handler500 # flake8
urlpatterns = (
url(
r'^authority/permission/add/(?P<app_label>[\w\-]+)/(?P<module_name>[\w\-]+)/(?P<pk>\d+)/$', # noqa
view=authority.views.add_permission,
name="authority-add-permission",
kwargs={'approved': True, 'form_class': SpecialUserPermissionForm}
),
url(
r'^request/add/(?P<app_label>[\w\-]+)/(?P<module_name>[\w\-]+)/(?P<pk>\d+)/$', # noqa
view=authority.views.add_permission,
name="authority-add-permission-request",
kwargs={'approved': False, 'form_class': SpecialUserPermissionForm}
),
url(r'^authority/', include(authority.urls)),
url(r'^accounts/login/$', django.contrib.auth.views.login),
url(
r'^(?P<url>[\/0-9A-Za-z]+)$',
example.exampleapp.views.top_secret,
{'lala': 'oh yeah!'},
),
)
if settings.DEBUG:
urlpatterns += (
url(r'^media/(?P<path>.*)$', django.views.static.serve, {
'document_root': settings.MEDIA_ROOT,
}),
)