mirror of
https://github.com/ansible/awx.git
synced 2026-03-15 07:57:29 -02:30
Fix up deprecation warning about re_path() replacing urls()
This commit is contained in:
25
awx/urls.py
25
awx/urls.py
@@ -1,29 +1,30 @@
|
||||
# Copyright (c) 2015 Ansible, Inc.
|
||||
# All Rights Reserved.
|
||||
|
||||
from django.conf.urls import url, include
|
||||
from django.conf import settings
|
||||
from django.urls import re_path, include
|
||||
|
||||
from awx.main.views import handle_400, handle_403, handle_404, handle_500, handle_csp_violation, handle_login_redirect
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
url(r'', include('awx.ui.urls', namespace='ui')),
|
||||
url(r'^api/', include('awx.api.urls', namespace='api')),
|
||||
url(r'^sso/', include('awx.sso.urls', namespace='sso')),
|
||||
url(r'^sso/', include('social_django.urls', namespace='social')),
|
||||
url(r'^(?:api/)?400.html$', handle_400),
|
||||
url(r'^(?:api/)?403.html$', handle_403),
|
||||
url(r'^(?:api/)?404.html$', handle_404),
|
||||
url(r'^(?:api/)?500.html$', handle_500),
|
||||
url(r'^csp-violation/', handle_csp_violation),
|
||||
url(r'^login/', handle_login_redirect),
|
||||
re_path(r'', include('awx.ui.urls', namespace='ui')),
|
||||
re_path(r'^api/', include('awx.api.urls', namespace='api')),
|
||||
re_path(r'^sso/', include('awx.sso.urls', namespace='sso')),
|
||||
re_path(r'^sso/', include('social_django.urls', namespace='social')),
|
||||
re_path(r'^(?:api/)?400.html$', handle_400),
|
||||
re_path(r'^(?:api/)?403.html$', handle_403),
|
||||
re_path(r'^(?:api/)?404.html$', handle_404),
|
||||
re_path(r'^(?:api/)?500.html$', handle_500),
|
||||
re_path(r'^csp-violation/', handle_csp_violation),
|
||||
re_path(r'^login/', handle_login_redirect),
|
||||
]
|
||||
|
||||
if settings.SETTINGS_MODULE == 'awx.settings.development':
|
||||
try:
|
||||
import debug_toolbar
|
||||
|
||||
urlpatterns += [url(r'^__debug__/', include(debug_toolbar.urls))]
|
||||
urlpatterns += [re_path(r'^__debug__/', include(debug_toolbar.urls))]
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user