Skip to content

Commit

Permalink
django.conf.urls.url() was deprecated in Django 3, and removed in Dja…
Browse files Browse the repository at this point in the history
…ngo 4
  • Loading branch information
niol committed Dec 16, 2023
1 parent 0ec7201 commit c2ced98
Show file tree
Hide file tree
Showing 12 changed files with 89 additions and 89 deletions.
10 changes: 5 additions & 5 deletions webapp/graphite/account/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
See the License for the specific language governing permissions and
limitations under the License."""

from django.conf.urls import url
from django.urls import re_path
from . import views

urlpatterns = [
url(r'^/login/?$', views.loginView, name='account_login'),
url(r'^/logout/?$', views.logoutView, name='account_logout'),
url(r'^/edit/?$', views.editProfile, name='account_edit'),
url(r'^/update/?$', views.updateProfile, name='account_update'),
re_path(r'^/login/?$', views.loginView, name='account_login'),
re_path(r'^/logout/?$', views.logoutView, name='account_logout'),
re_path(r'^/edit/?$', views.editProfile, name='account_edit'),
re_path(r'^/update/?$', views.updateProfile, name='account_update'),
]
12 changes: 6 additions & 6 deletions webapp/graphite/browser/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
See the License for the specific language governing permissions and
limitations under the License."""

from django.conf.urls import url
from django.urls import re_path
from . import views

urlpatterns = [
url(r'^/header/?$', views.header, name='browser_header'),
url(r'^/search/?$', views.search, name='browser_search'),
url(r'^/mygraph/?$', views.myGraphLookup, name='browser_my_graph'),
url(r'^/usergraph/?$', views.userGraphLookup, name='browser_usergraph'),
url(r'^/?$', views.browser, name='browser'),
re_path(r'^/header/?$', views.header, name='browser_header'),
re_path(r'^/search/?$', views.search, name='browser_search'),
re_path(r'^/mygraph/?$', views.myGraphLookup, name='browser_my_graph'),
re_path(r'^/usergraph/?$', views.userGraphLookup, name='browser_usergraph'),
re_path(r'^/?$', views.browser, name='browser'),
]
6 changes: 3 additions & 3 deletions webapp/graphite/composer/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
See the License for the specific language governing permissions and
limitations under the License."""

from django.conf.urls import url
from django.urls import re_path
from . import views

urlpatterns = [
url(r'^/mygraph', views.mygraph, name='composer_mygraph'),
url(r'^/?$', views.composer, name='composer'),
re_path(r'^/mygraph', views.mygraph, name='composer_mygraph'),
re_path(r'^/?$', views.composer, name='composer'),
]
44 changes: 22 additions & 22 deletions webapp/graphite/dashboard/urls.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
from django.conf.urls import url
from django.urls import re_path
from . import views

urlpatterns = [
url(r'^/save/(?P<name>[^/]+)$', views.save, name='dashboard_save'),
url(r'^/save_template/(?P<name>[^/]+)/(?P<key>[^/]+)$', views.save_template,
name='dashboard_save_template'),
url(r'^/load/(?P<name>[^/]+)$', views.load, name='dashboard_load'),
url(r'^/load/(?P<name>[^/]+)/(?P<val>[^/]+)$', views.load_template,
name='dashboard_load_template'),
url(r'^/load_template/(?P<name>[^/]+)/(?P<val>[^/]+)$', views.load_template,
name='dashboard_load_template'),
url(r'^/delete/(?P<name>[^/]+)$', views.delete, name='dashboard_delete'),
url(r'^/create-temporary/?$', views.create_temporary, name='dashboard_create_temporary'),
url(r'^/email$', views.email, name='dashboard_email'),
url(r'^/find/?$', views.find, name='dashboard_find'),
url(r'^/delete_template/(?P<name>[^/]+)$', views.delete_template,
name='dashboard_delete_template'),
url(r'^/find_template/?$', views.find_template, name='dashboard_find_template'),
url(r'^/login/?$', views.user_login, name='dashboard_login'),
url(r'^/logout/?$', views.user_logout, name='dashboard_logout'),
url(r'^/help/?$', views.help, name='dashboard_help'),
url(r'^/(?P<name>[^/]+)/(?P<val>[^/]+)$', views.template, name='dashboard_template'),
url(r'^/(?P<name>[^/]+)$', views.dashboard, name='dashboard'),
url(r'^/?$', views.dashboard, name='dashboard'),
re_path(r'^/save/(?P<name>[^/]+)$', views.save, name='dashboard_save'),
re_path(r'^/save_template/(?P<name>[^/]+)/(?P<key>[^/]+)$', views.save_template,
name='dashboard_save_template'),
re_path(r'^/load/(?P<name>[^/]+)$', views.load, name='dashboard_load'),
re_path(r'^/load/(?P<name>[^/]+)/(?P<val>[^/]+)$', views.load_template,
name='dashboard_load_template'),
re_path(r'^/load_template/(?P<name>[^/]+)/(?P<val>[^/]+)$', views.load_template,
name='dashboard_load_template'),
re_path(r'^/delete/(?P<name>[^/]+)$', views.delete, name='dashboard_delete'),
re_path(r'^/create-temporary/?$', views.create_temporary, name='dashboard_create_temporary'),
re_path(r'^/email$', views.email, name='dashboard_email'),
re_path(r'^/find/?$', views.find, name='dashboard_find'),
re_path(r'^/delete_template/(?P<name>[^/]+)$', views.delete_template,
name='dashboard_delete_template'),
re_path(r'^/find_template/?$', views.find_template, name='dashboard_find_template'),
re_path(r'^/login/?$', views.user_login, name='dashboard_login'),
re_path(r'^/logout/?$', views.user_logout, name='dashboard_logout'),
re_path(r'^/help/?$', views.help, name='dashboard_help'),
re_path(r'^/(?P<name>[^/]+)/(?P<val>[^/]+)$', views.template, name='dashboard_template'),
re_path(r'^/(?P<name>[^/]+)$', views.dashboard, name='dashboard'),
re_path(r'^/?$', views.dashboard, name='dashboard'),
]
8 changes: 4 additions & 4 deletions webapp/graphite/events/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
See the License for the specific language governing permissions and
limitations under the License."""

from django.conf.urls import url
from django.urls import re_path
from . import views

urlpatterns = [
url(r'^/get_data?$', views.get_data, name='events_get_data'),
url(r'^/(?P<event_id>\d+)/?$', views.detail, name='events_detail'),
url(r'^/?$', views.view_events, name='events'),
re_path(r'^/get_data?$', views.get_data, name='events_get_data'),
re_path(r'^/(?P<event_id>\d+)/?$', views.detail, name='events_detail'),
re_path(r'^/?$', views.view_events, name='events'),
]
6 changes: 3 additions & 3 deletions webapp/graphite/functions/urls.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.conf.urls import url
from django.urls import re_path
from graphite.functions.views import functionList, functionDetails

urlpatterns = [
url(r'^/(.+)$', functionDetails, name='functionDetails'),
url(r'^/?$', functionList, name='functionList'),
re_path(r'^/(.+)$', functionDetails, name='functionDetails'),
re_path(r'^/?$', functionList, name='functionList'),
]
18 changes: 9 additions & 9 deletions webapp/graphite/metrics/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
See the License for the specific language governing permissions and
limitations under the License."""

from django.conf.urls import url
from django.urls import path, re_path
from . import views

urlpatterns = [
url(r'^/index\.json$', views.index_json, name='metrics_index'),
url(r'^/find/?$', views.find_view, name='metrics_find'),
url(r'^/expand/?$', views.expand_view, name='metrics_expand'),
url(r'^/get-metadata/?$', views.get_metadata_view,
name='metrics_get_metadata'),
url(r'^/set-metadata/?$', views.set_metadata_view,
name='metrics_set_metadata'),
url(r'^/?$', views.find_view, name='metrics'),
path('/index.json', views.index_json, name='metrics_index'),
re_path(r'^/find/?$', views.find_view, name='metrics_find'),
re_path(r'^/expand/?$', views.expand_view, name='metrics_expand'),
re_path(r'^/get-metadata/?$', views.get_metadata_view,
name='metrics_get_metadata'),
re_path(r'^/set-metadata/?$', views.set_metadata_view,
name='metrics_set_metadata'),
re_path(r'^/?$', views.find_view, name='metrics'),
]
10 changes: 5 additions & 5 deletions webapp/graphite/render/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
See the License for the specific language governing permissions and
limitations under the License."""

from django.conf.urls import url
from django.urls import re_path
from . import views

urlpatterns = [
url(r'^/local/?$', views.renderLocalView, name='render_local'),
url(r'^/~(?P<username>[^/]+)/(?P<graphName>[^/]+)/?$', views.renderMyGraphView,
name='render_my_graph'),
url(r'^/?$', views.renderView, name='render'),
re_path(r'^/local/?$', views.renderLocalView, name='render_local'),
re_path(r'^/~(?P<username>[^/]+)/(?P<graphName>[^/]+)/?$', views.renderMyGraphView,
name='render_my_graph'),
re_path(r'^/?$', views.renderView, name='render'),
]
18 changes: 9 additions & 9 deletions webapp/graphite/tags/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
See the License for the specific language governing permissions and
limitations under the License."""

from django.conf.urls import url
from django.urls import path, re_path
from . import views

urlpatterns = [
url(r'^/tagSeries$', views.tagSeries, name='tagSeries'),
url(r'^/tagMultiSeries$', views.tagMultiSeries, name='tagMultiSeries'),
url(r'^/delSeries$', views.delSeries, name='delSeries'),
url(r'^/findSeries$', views.findSeries, name='findSeries'),
url(r'^/autoComplete/tags$', views.autoCompleteTags, name='tagAutoCompleteTags'),
url(r'^/autoComplete/values$', views.autoCompleteValues, name='tagAutoCompleteValues'),
url(r'^/(.+)$', views.tagDetails, name='tagDetails'),
url(r'^/?$', views.tagList, name='tagList'),
path('/tagSeries', views.tagSeries, name='tagSeries'),
path('/tagMultiSeries', views.tagMultiSeries, name='tagMultiSeries'),
path('/delSeries', views.delSeries, name='delSeries'),
path('/findSeries', views.findSeries, name='findSeries'),
path('/autoComplete/tags', views.autoCompleteTags, name='tagAutoCompleteTags'),
path('/autoComplete/values', views.autoCompleteValues, name='tagAutoCompleteValues'),
re_path(r'^/(.+)$', views.tagDetails, name='tagDetails'),
re_path(r'^/?$', views.tagList, name='tagList'),
]
34 changes: 17 additions & 17 deletions webapp/graphite/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,32 @@
See the License for the specific language governing permissions and
limitations under the License"""
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.urls import include, path, re_path
from graphite.url_shortener.views import shorten, follow
from graphite.browser.views import browser

graphite_urls = [
url('^admin/', admin.site.urls),
url('^render', include('graphite.render.urls')),
url('^composer', include('graphite.composer.urls')),
url('^metrics', include('graphite.metrics.urls')),
url('^browser', include('graphite.browser.urls')),
url('^account', include('graphite.account.urls')),
url('^dashboard', include('graphite.dashboard.urls')),
url('^whitelist', include('graphite.whitelist.urls')),
url('^version', include('graphite.version.urls')),
url('^events', include('graphite.events.urls')),
url('^tags', include('graphite.tags.urls')),
url('^functions', include('graphite.functions.urls')),
url('^s/(?P<path>.*)', shorten, name='shorten'),
url('^S/(?P<link_id>[a-zA-Z0-9]+)/?$', follow, name='follow'),
url('^$', browser, name='browser'),
path('admin/', admin.site.urls),
path('render', include('graphite.render.urls')),
path('composer', include('graphite.composer.urls')),
path('metrics', include('graphite.metrics.urls')),
path('browser', include('graphite.browser.urls')),
path('account', include('graphite.account.urls')),
path('dashboard', include('graphite.dashboard.urls')),
path('whitelist', include('graphite.whitelist.urls')),
path('version', include('graphite.version.urls')),
path('events', include('graphite.events.urls')),
path('tags', include('graphite.tags.urls')),
path('functions', include('graphite.functions.urls')),
re_path('^s/(?P<path>.*)', shorten, name='shorten'),
re_path('^S/(?P<link_id>[a-zA-Z0-9]+)/?$', follow, name='follow'),
path('', browser, name='browser'),
]

if settings.URL_PREFIX.strip('/'):
urlpatterns = [
url(r'^{0}/'.format(settings.URL_PREFIX.strip('/')), include(graphite_urls)),
re_path(r'^{0}/'.format(settings.URL_PREFIX.strip('/')), include(graphite_urls)),
]
else:
urlpatterns = graphite_urls
Expand Down
4 changes: 2 additions & 2 deletions webapp/graphite/version/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
See the License for the specific language governing permissions and
limitations under the License."""

from django.conf.urls import url
from django.urls import re_path
from . import views

urlpatterns = [
url(r'^/?$', views.index, name='version_index'),
re_path(r'^/?$', views.index, name='version_index'),
]
8 changes: 4 additions & 4 deletions webapp/graphite/whitelist/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
See the License for the specific language governing permissions and
limitations under the License."""

from django.conf.urls import url
from django.urls import path, re_path
from . import views

urlpatterns = [
url(r'^/add$', views.add, name='whitelist_add'),
url(r'^/remove$', views.remove, name='whitelist_remove'),
url(r'^/?$', views.show, name='whitelist_show'),
path('/add', views.add, name='whitelist_add'),
path('/remove', views.remove, name='whitelist_remove'),
re_path(r'^/?$', views.show, name='whitelist_show'),
]

0 comments on commit c2ced98

Please sign in to comment.