Skip to content

Commit

Permalink
Bump support to Django 4.x.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdlaird committed Feb 6, 2024
1 parent 9ca6450 commit 3ef979a
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
14 changes: 7 additions & 7 deletions conf/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sys

from django.conf import settings as config
from django.conf.urls import include, url
from django.urls import include, re_path
from django.views import static

import myproject.auth.urls
Expand All @@ -14,25 +14,25 @@

__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Alex Laird"
__version__ = "0.2.0"
__version__ = "0.6.0"

urlpatterns = [
# Include app-specific URL files
url(r'^', include(myproject.common.urls)),
url(r'^', include(myproject.auth.urls)),
url(r'^', include(myproject.myapp.urls)),
re_path(r'^', include(myproject.common.urls)),
re_path(r'^', include(myproject.auth.urls)),
re_path(r'^', include(myproject.myapp.urls)),
]

if config.DEBUG:
import debug_toolbar

urlpatterns += [
url(r'^__debug__/', include(debug_toolbar.urls)),
re_path(r'^__debug__/', include(debug_toolbar.urls)),
]

if config.DEBUG or 'test' in sys.argv:
# Ensure media files are shown properly when using a dev server
urlpatterns += [
url(r'^' + config.MEDIA_URL.lstrip('/') + '(?P<path>.*)$', static.serve, {
re_path(r'^' + config.MEDIA_URL.lstrip('/') + '(?P<path>.*)$', static.serve, {
'document_root': config.MEDIA_ROOT})
]
14 changes: 7 additions & 7 deletions myproject/auth/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
Authentication URLs.
"""

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

from myproject.auth.views import login, logout, forgot, settings, register

__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Alex Laird"
__version__ = "0.2.0"
__version__ = "0.6.0"

urlpatterns = [
# Authentication URLs
url(r'^register$', register, name='register'),
url(r'^login$', login, name='login'),
url(r'^logout', logout, name='logout'),
url(r'^forgot$', forgot, name='forgot'),
re_path(r'^register$', register, name='register'),
re_path(r'^login$', login, name='login'),
re_path(r'^logout', logout, name='logout'),
re_path(r'^forgot$', forgot, name='forgot'),

# Account URLs
url(r'^settings$', settings, name='settings'),
re_path(r'^settings$', settings, name='settings'),
]
16 changes: 8 additions & 8 deletions myproject/common/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.conf import settings as config
from django.conf.urls import url
from django.urls import re_path
from django.contrib.sitemaps.views import sitemap
from django.views.generic import RedirectView, TemplateView

Expand All @@ -9,22 +9,22 @@

__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Alex Laird"
__version__ = "0.3.1"
__version__ = "0.6.0"

sitemaps = {
'static': StaticViewSitemap,
}

urlpatterns = [
# Top-level URLs
url(r'^admin/', admin_site.urls),
re_path(r'^admin/', admin_site.urls),

# Crawler shortcuts and placeholders
url(r'^sitemap\.xml$', sitemap, {'sitemaps': sitemaps}),
url(r'^robots\.txt$', TemplateView.as_view(template_name='robots.txt', content_type='text/plain; charset=utf-8')),
url(r'^favicon\.ico$', RedirectView.as_view(url=config.STATIC_URL + 'favicon.ico', permanent=True)),
url(r'^favicon\.png$', RedirectView.as_view(url=config.STATIC_URL + 'favicon.png', permanent=True)),
re_path(r'^sitemap\.xml$', sitemap, {'sitemaps': sitemaps}),
re_path(r'^robots\.txt$', TemplateView.as_view(template_name='robots.txt', content_type='text/plain; charset=utf-8')),
re_path(r'^favicon\.ico$', RedirectView.as_view(url=config.STATIC_URL + 'favicon.ico', permanent=True)),
re_path(r'^favicon\.png$', RedirectView.as_view(url=config.STATIC_URL + 'favicon.png', permanent=True)),

# General URLs
url(r'^$', home, name='home'),
re_path(r'^$', home, name='home'),
]
6 changes: 3 additions & 3 deletions myproject/myapp/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
Authenticated app URLs.
"""

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

from myproject.myapp.views import portal

__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Alex Laird"
__version__ = "0.2.0"
__version__ = "0.6.0"

urlpatterns = [
# Authenticated URLs
url(r'^portal', portal, name='portal'),
re_path(r'^portal', portal, name='portal'),
]
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
coverage==7.4.1
django==3.2.23
django==4.2.9
django-pipeline==3.0.0
django-widget-tweaks==1.5.0
django-dotenv==1.4.2
Expand Down

0 comments on commit 3ef979a

Please sign in to comment.