urls.py 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. from django.conf import settings
  2. from django.conf.urls.defaults import *
  3. from historical import views as hi_views
  4. from historical.models import HistoricArticle
  5. # custom views for groups & index
  6. urlpatterns = patterns(
  7. "historical.views",
  8. url(r"^$", view=hi_views.index, name="hi-index"),
  9. url(r"^(?P<slug>[\-\d\w]+)/$", view=hi_views.group_detail, name="hi-group-detail"),
  10. url(
  11. r"^(?P<group_slug>[\-\d\w]+)/(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/(?P<slug>[\-\d\w]+)/$",
  12. view=hi_views.article_detail,
  13. name="hi-article-detail",
  14. ),
  15. url(
  16. r"^(?P<group_slug>[\-\d\w]+)/(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\w{1,2})/$",
  17. view=hi_views.article_archive_day,
  18. name="hi-article-archive-day",
  19. ),
  20. url(
  21. r"^(?P<group_slug>[\-\d\w]+)/(?P<year>\d{4})/(?P<month>[a-z]{3})/$",
  22. view=hi_views.article_archive_month,
  23. name="hi-article-archive-month",
  24. ),
  25. url(
  26. r"^(?P<group_slug>[\-\d\w]+)/(?P<year>\d{4})/$",
  27. view=hi_views.article_archive_year,
  28. name="hi-article-archive-year",
  29. ),
  30. )