urls.py
83 lines
| 3.2 KiB
| text/x-python
|
PythonLexer
/ boards / urls.py
Ilyas
|
r78 | from django.conf.urls import patterns, url, include | ||
neko259
|
r0 | from boards import views | ||
neko259
|
r89 | from boards.rss import AllThreadsFeed, TagThreadsFeed, ThreadPostsFeed | ||
neko259
|
r547 | from boards.views import api, tag_threads, all_threads, archived_threads, \ | ||
neko259
|
r550 | login, settings, all_tags | ||
neko259
|
r551 | from boards.views.authors import AuthorsView | ||
neko259
|
r552 | from boards.views.delete_post import DeletePostView | ||
neko259
|
r553 | from boards.views.ban import BanUserView | ||
neko259
|
r565 | from boards.views.static import StaticPageView | ||
neko259
|
r566 | from boards.views.post_admin import PostAdminView | ||
neko259
|
r0 | |||
neko259
|
r122 | js_info_dict = { | ||
'packages': ('boards',), | ||||
} | ||||
neko259
|
r0 | urlpatterns = patterns('', | ||
Ilyas
|
r9 | |||
neko259
|
r0 | # /boards/ | ||
neko259
|
r542 | url(r'^$', all_threads.AllThreadsView.as_view(), name='index'), | ||
neko259
|
r46 | # /boards/page/ | ||
neko259
|
r542 | url(r'^page/(?P<page>\w+)/$', all_threads.AllThreadsView.as_view(), | ||
name='index'), | ||||
Ilyas
|
r9 | |||
neko259
|
r542 | url(r'^archive/$', archived_threads.ArchiveView.as_view(), name='archive'), | ||
url(r'^archive/page/(?P<page>\w+)/$', | ||||
archived_threads.ArchiveView.as_view(), name='archive'), | ||||
neko259
|
r484 | |||
Ilyas
|
r9 | # login page | ||
neko259
|
r544 | url(r'^login/$', login.LoginView.as_view(), name='login'), | ||
Ilyas
|
r9 | |||
neko259
|
r46 | # /boards/tag/tag_name/ | ||
neko259
|
r542 | url(r'^tag/(?P<tag_name>\w+)/$', tag_threads.TagView.as_view(), | ||
name='tag'), | ||||
neko259
|
r46 | # /boards/tag/tag_id/page/ | ||
neko259
|
r542 | url(r'^tag/(?P<tag_name>\w+)/page/(?P<page>\w+)/$', | ||
tag_threads.TagView.as_view(), name='tag'), | ||||
neko259
|
r145 | |||
neko259
|
r46 | # /boards/thread/ | ||
neko259
|
r542 | url(r'^thread/(?P<post_id>\w+)/$', views.thread.ThreadView.as_view(), | ||
name='thread'), | ||||
neko259
|
r580 | url(r'^thread/(?P<post_id>\w+)/mode/(?P<mode>\w+)/$', views.thread.ThreadView | ||
neko259
|
r542 | .as_view(), name='thread_mode'), | ||
neko259
|
r550 | |||
neko259
|
r566 | # /boards/post_admin/ | ||
url(r'^post_admin/(?P<post_id>\w+)/$', PostAdminView.as_view(), | ||||
name='post_admin'), | ||||
neko259
|
r547 | url(r'^settings/$', settings.SettingsView.as_view(), name='settings'), | ||
neko259
|
r550 | url(r'^tags/$', all_tags.AllTagsView.as_view(), name='tags'), | ||
Ilyas
|
r78 | url(r'^captcha/', include('captcha.urls')), | ||
neko259
|
r551 | url(r'^authors/$', AuthorsView.as_view(), name='authors'), | ||
neko259
|
r552 | url(r'^delete/(?P<post_id>\w+)/$', DeletePostView.as_view(), | ||
neko259
|
r566 | name='delete'), | ||
neko259
|
r553 | url(r'^ban/(?P<post_id>\w+)/$', BanUserView.as_view(), name='ban'), | ||
neko259
|
r156 | |||
neko259
|
r545 | url(r'^banned/$', views.banned.BannedView.as_view(), name='banned'), | ||
neko259
|
r565 | url(r'^staticpage/(?P<name>\w+)/$', StaticPageView.as_view(), | ||
neko259
|
r577 | name='staticpage'), | ||
neko259
|
r89 | |||
# RSS feeds | ||||
url(r'^rss/$', AllThreadsFeed()), | ||||
neko259
|
r91 | url(r'^page/(?P<page>\w+)/rss/$', AllThreadsFeed()), | ||
neko259
|
r89 | url(r'^tag/(?P<tag_name>\w+)/rss/$', TagThreadsFeed()), | ||
neko259
|
r91 | url(r'^tag/(?P<tag_name>\w+)/page/(?P<page>\w+)/rss/$', TagThreadsFeed()), | ||
neko259
|
r89 | url(r'^thread/(?P<post_id>\w+)/rss/$', ThreadPostsFeed()), | ||
neko259
|
r122 | |||
neko259
|
r221 | # i18n | ||
neko259
|
r566 | url(r'^jsi18n/$', 'boards.views.cached_js_catalog', js_info_dict, | ||
name='js_info_dict'), | ||||
neko259
|
r221 | |||
# API | ||||
neko259
|
r500 | url(r'^api/post/(?P<post_id>\w+)/$', api.get_post, name="get_post"), | ||
neko259
|
r363 | url(r'^api/diff_thread/(?P<thread_id>\w+)/(?P<last_update_time>\w+)/$', | ||
neko259
|
r500 | api.api_get_threaddiff, name="get_thread_diff"), | ||
url(r'^api/threads/(?P<count>\w+)/$', api.api_get_threads, | ||||
name='get_threads'), | ||||
neko259
|
r542 | url(r'^api/tags/$', api.api_get_tags, name='get_tags'), | ||
url(r'^api/thread/(?P<opening_post_id>\w+)/$', api.api_get_thread_posts, | ||||
neko259
|
r502 | name='get_thread'), | ||
neko259
|
r566 | url(r'^api/add_post/(?P<opening_post_id>\w+)/$', api.api_add_post, | ||
name='add_post'), | ||||
neko259
|
r500 | |||
neko259
|
r137 | ) | ||