new django.urls.path() function allows a simpler, more readable URL routing syntax.

This commit is contained in:
trhr 2020-02-09 20:36:30 -06:00
parent 09c84600e0
commit 9389e8aec7
2 changed files with 8 additions and 6 deletions

View file

@ -6,7 +6,7 @@
# http://diveintopython.org/regular_expressions/street_addresses.html#re.matching.2.3
#
from django.conf.urls import url, include
from django.urls import path, include
from django.views.generic import RedirectView
# Setup the root url tree from /
@ -14,9 +14,10 @@ from django.views.generic import RedirectView
urlpatterns = [
# Front page (note that we shouldn't specify namespace here since we will
# not be able to load django-auth/admin stuff (will probably work in Django>1.9)
url(r"^", include("evennia.web.website.urls")), # , namespace='website', app_name='website')),
path("", include("evennia.web.website.urls")),
# webclient
url(r"^webclient/", include("evennia.web.webclient.urls", namespace="webclient")),
path("webclient/", include("evennia.web.webclient.urls")),
# favicon
url(r"^favicon\.ico$", RedirectView.as_view(url="/media/images/favicon.ico", permanent=False)),
path("favicon.ico", RedirectView.as_view(
url="/media/images/favicon.ico", permanent=False))
]

View file

@ -2,8 +2,9 @@
This structures the (simple) structure of the
webpage 'application'.
"""
from django.conf.urls import *
from django.urls import path
from evennia.web.webclient import views as webclient_views
app_name = "webclient"
urlpatterns = [url(r"^$", webclient_views.webclient, name="index")]
urlpatterns = [path("", webclient_views.webclient, name="index")]