new django.urls.path() function allows a simpler, more readable URL routing syntax.
This commit is contained in:
parent
308818bd5d
commit
a3169b50c2
2 changed files with 8 additions and 6 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
# http://diveintopython.org/regular_expressions/street_addresses.html#re.matching.2.3
|
# 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
|
from django.views.generic import RedirectView
|
||||||
|
|
||||||
# Setup the root url tree from /
|
# Setup the root url tree from /
|
||||||
|
|
@ -14,9 +14,10 @@ from django.views.generic import RedirectView
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
# Front page (note that we shouldn't specify namespace here since we will
|
# 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)
|
# 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
|
# webclient
|
||||||
url(r"^webclient/", include("evennia.web.webclient.urls", namespace="webclient")),
|
path("webclient/", include("evennia.web.webclient.urls")),
|
||||||
# favicon
|
# 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))
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,9 @@
|
||||||
This structures the (simple) structure of the
|
This structures the (simple) structure of the
|
||||||
webpage 'application'.
|
webpage 'application'.
|
||||||
"""
|
"""
|
||||||
from django.conf.urls import *
|
from django.urls import path
|
||||||
from evennia.web.webclient import views as webclient_views
|
from evennia.web.webclient import views as webclient_views
|
||||||
|
|
||||||
app_name = "webclient"
|
app_name = "webclient"
|
||||||
urlpatterns = [url(r"^$", webclient_views.webclient, name="index")]
|
|
||||||
|
urlpatterns = [path("", webclient_views.webclient, name="index")]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue