2013-09-24 13:54:41 +00:00
|
|
|
from django.conf.urls import patterns, url
|
2015-03-12 13:29:37 +00:00
|
|
|
from django.views.generic import RedirectView
|
2015-04-25 19:48:44 +00:00
|
|
|
from django.core.urlresolvers import reverse_lazy
|
|
|
|
|
2013-09-24 13:54:41 +00:00
|
|
|
from blog import views
|
|
|
|
|
|
|
|
urlpatterns = patterns('',
|
2014-04-21 08:39:43 +00:00
|
|
|
url(
|
|
|
|
r'^$',
|
|
|
|
views.index,
|
|
|
|
name = 'index'
|
|
|
|
),
|
|
|
|
url(
|
|
|
|
r'^page/(?P<page>\d+)$',
|
|
|
|
views.indexpage,
|
|
|
|
name = 'indexpage'
|
|
|
|
),
|
|
|
|
url(
|
|
|
|
r'^tag/(?P<tag>[^/]+)$',
|
|
|
|
views.taglist,
|
|
|
|
name = 'taglist'
|
|
|
|
),
|
|
|
|
url(
|
|
|
|
r'^tag/(?P<tag>[^/]+)/page/(?P<page>\d+)$',
|
|
|
|
views.tagpage,
|
|
|
|
name = 'tagpage'
|
|
|
|
),
|
|
|
|
url(
|
|
|
|
r'^(?P<year>\d+)/(?P<month>\d+)/(?P<day>\d+)/?$',
|
|
|
|
views.datelist,
|
|
|
|
name = 'datelist'
|
|
|
|
),
|
|
|
|
url(
|
|
|
|
r'^(?P<year>\d+)/(?P<month>\d+)/(?P<day>\d+)/page/(?P<page>\d+)$',
|
|
|
|
views.datepage,
|
|
|
|
name = 'datepage'
|
|
|
|
),
|
|
|
|
url(
|
|
|
|
r'^(?P<year>\d+)/(?P<month>\d+)/(?P<day>\d+)/(?P<slug>[^/]+)$',
|
|
|
|
views.read,
|
|
|
|
name = 'read'
|
|
|
|
),
|
|
|
|
url(
|
|
|
|
r'^code-chunk/(?P<language>[^/]+)/(?P<slug>[^/]+)$',
|
|
|
|
views.codechunk,
|
|
|
|
name = 'codechunk'
|
|
|
|
),
|
|
|
|
url(
|
2015-03-12 13:29:37 +00:00
|
|
|
r'^atom.xml$',
|
2014-04-21 08:39:43 +00:00
|
|
|
views.feed,
|
|
|
|
name = 'feed'
|
|
|
|
),
|
2015-03-12 13:29:37 +00:00
|
|
|
url(
|
|
|
|
r'^feed$',
|
2015-04-25 19:48:44 +00:00
|
|
|
RedirectView.as_view(url=reverse_lazy('blog:feed'))
|
2015-03-12 13:29:37 +00:00
|
|
|
),
|
2013-09-24 13:54:41 +00:00
|
|
|
)
|