2014-04-02 00:46:34 +00:00
|
|
|
from django.conf.urls import url
|
2014-08-12 14:54:42 +00:00
|
|
|
from django.contrib.auth import views as auth_views
|
2012-04-25 19:17:47 +00:00
|
|
|
from django.views.generic import RedirectView
|
2011-04-02 13:27:40 +00:00
|
|
|
|
2014-04-02 00:46:34 +00:00
|
|
|
from . import views
|
2015-01-28 12:35:27 +00:00
|
|
|
from .models import Article, DateArticle
|
2011-04-02 13:27:40 +00:00
|
|
|
|
|
|
|
date_based_info_dict = {
|
|
|
|
'queryset': Article.objects.all(),
|
|
|
|
'date_field': 'date_created',
|
|
|
|
'month_format': '%m',
|
|
|
|
}
|
|
|
|
|
|
|
|
object_list_dict = {
|
|
|
|
'queryset': Article.objects.all(),
|
|
|
|
'paginate_by': 2,
|
|
|
|
}
|
|
|
|
|
|
|
|
object_list_no_paginate_by = {
|
|
|
|
'queryset': Article.objects.all(),
|
|
|
|
}
|
|
|
|
|
|
|
|
numeric_days_info_dict = dict(date_based_info_dict, day_format='%d')
|
|
|
|
|
|
|
|
date_based_datefield_info_dict = dict(date_based_info_dict, queryset=DateArticle.objects.all())
|
|
|
|
|
2014-04-02 00:46:34 +00:00
|
|
|
urlpatterns = [
|
2016-05-15 15:28:00 +00:00
|
|
|
url(r'^accounts/login/$', auth_views.LoginView.as_view(template_name='login.html')),
|
|
|
|
url(r'^accounts/logout/$', auth_views.LogoutView.as_view()),
|
2011-04-02 13:27:40 +00:00
|
|
|
|
|
|
|
# Special URLs for particular regression cases.
|
2014-08-12 14:54:42 +00:00
|
|
|
url('^中文/target/$', views.index_page),
|
2014-04-02 00:46:34 +00:00
|
|
|
]
|
2011-04-02 13:27:40 +00:00
|
|
|
|
2014-03-02 14:25:53 +00:00
|
|
|
# redirects, both temporary and permanent, with non-ASCII targets
|
2014-04-02 00:46:34 +00:00
|
|
|
urlpatterns += [
|
|
|
|
url('^nonascii_redirect/$', RedirectView.as_view(
|
2012-06-07 16:08:47 +00:00
|
|
|
url='/中文/target/', permanent=False)),
|
2014-04-02 00:46:34 +00:00
|
|
|
url('^permanent_nonascii_redirect/$', RedirectView.as_view(
|
2012-06-07 16:08:47 +00:00
|
|
|
url='/中文/target/', permanent=True)),
|
2014-04-02 00:46:34 +00:00
|
|
|
]
|
|
|
|
|
2014-02-14 17:28:51 +00:00
|
|
|
# json response
|
2014-04-02 00:46:34 +00:00
|
|
|
urlpatterns += [
|
|
|
|
url(r'^json/response/$', views.json_response_view),
|
|
|
|
]
|