www-bocal/mainsite/urls.py

34 lines
818 B
Python
Raw Normal View History

2024-10-23 13:18:37 +02:00
from django.urls import path, register_converter
2017-09-21 19:01:47 +02:00
from . import views
2024-10-23 13:18:37 +02:00
class FourDigitYearConverter:
regex = "[0-9]{4}"
def to_python(self, value):
return int(value)
def to_url(self, value):
return "%04d" % value
register_converter(FourDigitYearConverter, "yyyy")
2017-09-21 14:00:10 +02:00
urlpatterns = [
2024-10-23 13:18:37 +02:00
path("", views.HomeView.as_view(), name="homepage"),
path("robots.txt", views.robots_view, name="robots"),
path("ecrire/", views.WriteArticleView.as_view(), name="write_article"),
path(
"speciaux/",
2019-01-19 17:28:24 +01:00
views.SpecialPublicationsView.as_view(),
name="special_publications",
),
2024-10-23 13:18:37 +02:00
path(
"<yyyy:year>-<yyyy:nYear>/",
2019-01-19 17:28:24 +01:00
views.YearView.as_view(),
name="year_view",
),
2024-10-23 13:18:37 +02:00
path("latest/", views.latestPublication, name="latestPublication"),
2017-09-21 14:00:10 +02:00
]