forked from liangliangyy/DjangoBlog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathurls.py
45 lines (37 loc) · 1.59 KB
/
urls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env python
# encoding: utf-8
"""
@version: ??
@author: liangliangyy
@license: MIT Licence
@contact: [email protected]
@site: https://www.lylinux.org/
@software: PyCharm
@file: urls.py
@time: 2016/11/2 下午7:15
"""
from django.urls import path
from django.views.decorators.cache import cache_page
from . import views
from haystack.forms import ModelSearchForm
from haystack.query import SearchQuerySet
from haystack.views import SearchView
app_name = "blog"
urlpatterns = [
path(r'', views.IndexView.as_view(), name='index'),
path(r'page/<int:page>/', views.IndexView.as_view(), name='index_page'),
path(r'article/<int:year>/<int:month>/<int:day>/<int:article_id>.html',
views.ArticleDetailView.as_view(),
name='detailbyid'),
path(r'category/<slug:category_name>.html', views.CategoryDetailView.as_view(), name='category_detail'),
path(r'category/<slug:category_name>/<int:page>.html', views.CategoryDetailView.as_view(),
name='category_detail_page'),
path(r'author/<author_name>.html', views.AuthorDetailView.as_view(), name='author_detail'),
path(r'author/<author_name>/<int:page>.html', views.AuthorDetailView.as_view(),
name='author_detail_page'),
path(r'tag/<slug:tag_name>.html', views.TagDetailView.as_view(), name='tag_detail'),
path(r'tag/<slug:tag_name>/<int:page>).html', views.TagDetailView.as_view(), name='tag_detail_page'),
path('archives.html', views.ArchivesView.as_view(), name='archives'),
path(r'upload', views.fileupload, name='upload'),
path(r'refresh', views.refresh_memcache, name='refresh')
]