django-authority/example/urls.py
Jason Ward 4cf4853232 Add support for Django 2.2 (#64)
* Updated tox to test only python{2,3}.7 and djagno1.11/2.2

* Updated travis.

* Updated models/migrations.

* Updated path to `reverse`

* Updated path to login view.

* Updated middlewares/installed apps

* Updated .travis again.

* Lets see if that will get tests working in python3 on travis.

* Switch to in memory DB for tests

* Stop running tests with python2.7 and django 2.2. They shouldn't work anyway.

* Sure did that wrong. Fix which python versions are running with which code.

* That isn't needed. Lets see if that is what is breaking python3.

* Testing a theory.

* Revert "Testing a theory."

This reverts commit 69b3e4c906.

* Added initial migration for example users.

* is_authenticated is a bool, not a method.
2020-01-24 16:04:44 +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.LoginView.as_view()),
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,
}),
)