forked from 00dani/lemoncurry
Port the global lemoncurry.urls URLconf to use path()
This commit is contained in:
parent
70e57e4155
commit
0239f7e031
1 changed files with 23 additions and 22 deletions
|
@ -14,11 +14,12 @@ Including another URLconf
|
||||||
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
|
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
|
||||||
"""
|
"""
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.conf.urls import include, url
|
from django.urls import include, path
|
||||||
from django.contrib import admin
|
|
||||||
from django.views.generic import RedirectView
|
from django.views.generic import RedirectView
|
||||||
|
|
||||||
|
from django.contrib import admin
|
||||||
import django.contrib.sitemaps.views as sitemap
|
import django.contrib.sitemaps.views as sitemap
|
||||||
|
|
||||||
from entries.sitemaps import EntriesSitemap
|
from entries.sitemaps import EntriesSitemap
|
||||||
from home.sitemaps import HomeSitemap
|
from home.sitemaps import HomeSitemap
|
||||||
|
|
||||||
|
@ -28,28 +29,28 @@ sections = {
|
||||||
}
|
}
|
||||||
maps = {'sitemaps': sections}
|
maps = {'sitemaps': sections}
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = (
|
||||||
url('', include('home.urls')),
|
path('', include('home.urls')),
|
||||||
url('', include('entries.urls')),
|
path('', include('entries.urls')),
|
||||||
url('', include('users.urls')),
|
path('', include('users.urls')),
|
||||||
url(r'^\.well-known/', include('wellknowns.urls')),
|
path('.well-known/', include('wellknowns.urls')),
|
||||||
url('^admin/doc/', include('django.contrib.admindocs.urls')),
|
path('admin/doc/', include('django.contrib.admindocs.urls')),
|
||||||
url('^admin/', admin.site.urls),
|
path('admin/', admin.site.urls),
|
||||||
url('^auth/', include('lemonauth.urls')),
|
path('auth/', include('lemonauth.urls')),
|
||||||
url(r'^favicon\.ico$', RedirectView.as_view(
|
path('favicon.ico', RedirectView.as_view(
|
||||||
url=settings.MEDIA_URL + 'favicon/favicon.ico')),
|
url=settings.MEDIA_URL + 'favicon/favicon.ico')),
|
||||||
url('^micropub', include('micropub.urls')),
|
path('micropub', include('micropub.urls')),
|
||||||
url('^s/', include('lemonshort.urls')),
|
path('s/', include('lemonshort.urls')),
|
||||||
url('^webmention', include('webmention.urls')),
|
path('webmention', include('webmention.urls')),
|
||||||
|
|
||||||
url(r'^django-rq/', include('django_rq.urls')),
|
path('django-rq/', include('django_rq.urls')),
|
||||||
url(r'^sitemap\.xml$', sitemap.index, maps, name='sitemap'),
|
path('sitemap.xml', sitemap.index, maps, name='sitemap'),
|
||||||
url(r'^sitemaps/(?P<section>.+)\.xml$', sitemap.sitemap, maps,
|
path('sitemaps/<section>.xml', sitemap.sitemap, maps,
|
||||||
name='django.contrib.sitemaps.views.sitemap'),
|
name='django.contrib.sitemaps.views.sitemap'),
|
||||||
]
|
)
|
||||||
|
|
||||||
if settings.DEBUG:
|
if settings.DEBUG:
|
||||||
import debug_toolbar
|
import debug_toolbar
|
||||||
urlpatterns = [
|
urlpatterns = (
|
||||||
url(r'^__debug__/', include(debug_toolbar.urls)),
|
path('__debug__/', include(debug_toolbar.urls)),
|
||||||
] + urlpatterns
|
) + urlpatterns
|
||||||
|
|
Loading…
Reference in a new issue