diff --git a/conservancy/blog/urls.py b/conservancy/blog/urls.py index 24f72194d485ac81e8fdeb48b4e4b8ff4048f9f9..1f750589792856bee28045ac225a42794d065751 100644 --- a/conservancy/blog/urls.py +++ b/conservancy/blog/urls.py @@ -1,6 +1,6 @@ from datetime import datetime -from django.conf.urls import url +from django.urls import path from ..staff.models import Person from .models import Entry, EntryTag @@ -23,12 +23,12 @@ info_dict = { } urlpatterns = [ - url(r'^(?P\d{4})/(?P[a-z]{3})/(?P\w{1,2})/(?P[-\w]+)/$', BlogDateDetailView.as_view(**info_dict)), - url(r'^(?P\d{4})/(?P[a-z]{3})/(?P\w{1,2})/$', BlogDayArchiveView.as_view(**info_dict)), - url(r'^(?P\d{4})/(?P[a-z]{3})/$', BlogMonthArchiveView.as_view(**info_dict)), - url(r'^(?P\d{4})/$', BlogYearArchiveView.as_view(**info_dict)), - url(r'^$', custom_index, dict(info_dict, paginate_by=4)), - url(r'^query/$', query), + path('////', BlogDateDetailView.as_view(**info_dict)), + path('///', BlogDayArchiveView.as_view(**info_dict)), + path('//', BlogMonthArchiveView.as_view(**info_dict)), + path('/', BlogYearArchiveView.as_view(**info_dict)), + path('', custom_index, dict(info_dict, paginate_by=4)), + path('query/', query), ] # Code to display authors and tags on each blog page diff --git a/conservancy/news/urls.py b/conservancy/news/urls.py index 33b57f74f7464f99d04347f732b80c344b19f432..a16d6885ea546a9ec6c3d65e2e0b7cb731ec7cda 100644 --- a/conservancy/news/urls.py +++ b/conservancy/news/urls.py @@ -18,7 +18,7 @@ # "AGPLv3". If not, see . from django.conf import settings -from django.conf.urls import include, url +from django.urls import path from .models import ExternalArticle, PressRelease from .views import ( @@ -39,9 +39,9 @@ external_article_dict = { } urlpatterns = [ - url(r'^(?P\d{4})/(?P[a-z]{3})/(?P\w{1,2})/(?P[-\w]+)/$', NewsDateDetailView.as_view(**info_dict)), - url(r'^(?P\d{4})/(?P[a-z]{3})/(?P\w{1,2})/$', NewsDayArchiveView.as_view(**info_dict)), - url(r'^(?P\d{4})/(?P[a-z]{3})/$', NewsMonthArchiveView.as_view(**info_dict)), - url(r'^(?P\d{4})/$', NewsYearArchiveView.as_view(**info_dict)), - url(r'^$', listing, dict(info_dict, paginate_by=6)), + path('////', NewsDateDetailView.as_view(**info_dict)), + path('///', NewsDayArchiveView.as_view(**info_dict)), + path('//', NewsMonthArchiveView.as_view(**info_dict)), + path('/', NewsYearArchiveView.as_view(**info_dict)), + path('', listing, dict(info_dict, paginate_by=6)), ] diff --git a/conservancy/supporter/urls.py b/conservancy/supporter/urls.py index 83541a3204f5256c6f32f1ce7104fd4a4e69a5a4..036446fcaab3f31528b5009b0d8f75c5bb86ea79 100644 --- a/conservancy/supporter/urls.py +++ b/conservancy/supporter/urls.py @@ -1,16 +1,12 @@ -from django.conf.urls import url +from django.urls import path, re_path from django.views.generic import TemplateView from . import views as supp_views from .. import views as static_views -INDEX_VIEW = supp_views.index urlpatterns = [ - url(r'^$', INDEX_VIEW), - url(r'^banners?/?$', TemplateView.as_view(template_name='supporter/banners.html')), + path('', supp_views.index), + path('banner/', TemplateView.as_view(template_name='supporter/banners.html')), + path('banners/', TemplateView.as_view(template_name='supporter/banners.html')), + re_path(r'', static_views.index), ] -urlpatterns.extend( - url(r'^{}(?:\.html|/|)$'.format(basename), INDEX_VIEW) - for basename in ['index', '2015-supporter-appeal', '2016-supporter-appeal'] -) -urlpatterns.append(url(r'', static_views.index)) diff --git a/conservancy/urls.py b/conservancy/urls.py index fd25781f02949f85d25a22aa6c39b057b0b0fdb3..98ebc2b52727fe2b7f2d7f4205362f0af95acdb1 100644 --- a/conservancy/urls.py +++ b/conservancy/urls.py @@ -28,7 +28,6 @@ admin.autodiscover() urlpatterns = [ path('', frontpage.view), - path('sponsors', frontpage.view), path('sponsors/', sponsors.view), path('sponsors/index.html', sponsors.view), path('admin/', admin.site.urls), @@ -39,23 +38,23 @@ urlpatterns = [ path('news/', include('conservancy.news.urls')), path('blog/', include('conservancy.blog.urls')), # formerly static templated things... (dirs with templates) - re_path(r'^about', static_views.index), - re_path(r'^activities', static_views.index), - re_path(r'^donate', static_views.index), - re_path(r'^copyleft-compliance', static_views.index, {'fundraiser_sought': 'vmware-match-0'}), - re_path(r'^learn', static_views.index), - re_path(r'^press', static_views.index), - re_path(r'^projects', static_views.index), + re_path(r'^about/', static_views.index), + re_path(r'^activities/', static_views.index), + re_path(r'^donate/', static_views.index), + re_path(r'^copyleft-compliance/', static_views.index, {'fundraiser_sought': 'vmware-match-0'}), + re_path(r'^learn/', static_views.index), + re_path(r'^press/', static_views.index), + re_path(r'^projects/', static_views.index), re_path(r'^GiveUpGitHub', static_views.index), - re_path(r'^npoacct', static_views.index, {'fundraiser_sought': 'npoacct'}), + re_path(r'^npoacct/', static_views.index, {'fundraiser_sought': 'npoacct'}), path('contractpatch/', include('conservancy.contractpatch.urls')), - re_path(r'^overview', static_views.index), - re_path(r'^privacy-policy', static_views.index), + re_path(r'^overview/', static_views.index), + re_path(r'^privacy-policy/', static_views.index), path('sustainer/', include('conservancy.supporter.urls')), re_path(r'^coming-soon.html', static_views.index), path('fundraiser_data/', fundgoal_views.view), path('assignment/', include('conservancy.assignment.urls')), - re_path(r'^fossy/$', static_views.index), + re_path(r'^fossy/', static_views.index), path('fossy/', include('conservancy.fossy.urls')), path('casts/the-corresponding-source/', include('conservancy.podjango.urls')), path('usethesource/', include('conservancy.usethesource.urls')),