urls.py
76 lines
| 3.0 KiB
| text/x-python
|
PythonLexer
/ boards / urls.py
|
r78 | from django.conf.urls import patterns, url, include | ||
|
r0 | from boards import views | ||
|
r89 | from boards.rss import AllThreadsFeed, TagThreadsFeed, ThreadPostsFeed | ||
|
r542 | from boards.views import api, tag_threads, all_threads, archived_threads | ||
|
r0 | |||
|
r122 | js_info_dict = { | ||
'packages': ('boards',), | ||||
} | ||||
|
r0 | urlpatterns = patterns('', | ||
|
r9 | |||
|
r0 | # /boards/ | ||
|
r542 | url(r'^$', all_threads.AllThreadsView.as_view(), name='index'), | ||
|
r46 | # /boards/page/ | ||
|
r542 | url(r'^page/(?P<page>\w+)/$', all_threads.AllThreadsView.as_view(), | ||
name='index'), | ||||
|
r9 | |||
|
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'), | ||||
|
r484 | |||
|
r9 | # login page | ||
|
r144 | url(r'^login/$', views.login, name='login'), | ||
|
r9 | |||
|
r46 | # /boards/tag/tag_name/ | ||
|
r542 | url(r'^tag/(?P<tag_name>\w+)/$', tag_threads.TagView.as_view(), | ||
name='tag'), | ||||
|
r46 | # /boards/tag/tag_id/page/ | ||
|
r542 | url(r'^tag/(?P<tag_name>\w+)/page/(?P<page>\w+)/$', | ||
tag_threads.TagView.as_view(), name='tag'), | ||||
|
r145 | |||
# /boards/tag/tag_name/unsubscribe/ | ||||
url(r'^tag/(?P<tag_name>\w+)/subscribe/$', views.tag_subscribe, | ||||
name='tag_subscribe'), | ||||
# /boards/tag/tag_name/unsubscribe/ | ||||
url(r'^tag/(?P<tag_name>\w+)/unsubscribe/$', views.tag_unsubscribe, | ||||
name='tag_unsubscribe'), | ||||
|
r46 | # /boards/thread/ | ||
|
r542 | url(r'^thread/(?P<post_id>\w+)/$', views.thread.ThreadView.as_view(), | ||
name='thread'), | ||||
url(r'^thread/(?P<post_id>\w+)/(?P<mode>\w+)/$', views.thread.ThreadView | ||||
.as_view(), name='thread_mode'), | ||||
|
r144 | url(r'^settings/$', views.settings, name='settings'), | ||
url(r'^tags/$', views.all_tags, name='tags'), | ||||
|
r78 | url(r'^captcha/', include('captcha.urls')), | ||
|
r103 | url(r'^jump/(?P<post_id>\w+)/$', views.jump_to_post, name='jumper'), | ||
url(r'^authors/$', views.authors, name='authors'), | ||||
|
r112 | url(r'^delete/(?P<post_id>\w+)/$', views.delete, name='delete'), | ||
|
r156 | url(r'^ban/(?P<post_id>\w+)/$', views.ban, name='ban'), | ||
|
r542 | url(r'^banned/$', views.banned.BannedView.as_view, name='banned'), | ||
|
r152 | url(r'^staticpage/(?P<name>\w+)/$', views.static_page, name='staticpage'), | ||
|
r89 | |||
# RSS feeds | ||||
url(r'^rss/$', AllThreadsFeed()), | ||||
|
r91 | url(r'^page/(?P<page>\w+)/rss/$', AllThreadsFeed()), | ||
|
r89 | url(r'^tag/(?P<tag_name>\w+)/rss/$', TagThreadsFeed()), | ||
|
r91 | url(r'^tag/(?P<tag_name>\w+)/page/(?P<page>\w+)/rss/$', TagThreadsFeed()), | ||
|
r89 | url(r'^thread/(?P<post_id>\w+)/rss/$', ThreadPostsFeed()), | ||
|
r122 | |||
|
r221 | # i18n | ||
|
r423 | url(r'^jsi18n/$', 'boards.views.cached_js_catalog', js_info_dict, name='js_info_dict'), | ||
|
r221 | |||
# API | ||||
|
r500 | url(r'^api/post/(?P<post_id>\w+)/$', api.get_post, name="get_post"), | ||
|
r363 | url(r'^api/diff_thread/(?P<thread_id>\w+)/(?P<last_update_time>\w+)/$', | ||
|
r500 | api.api_get_threaddiff, name="get_thread_diff"), | ||
url(r'^api/threads/(?P<count>\w+)/$', api.api_get_threads, | ||||
name='get_threads'), | ||||
|
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, | ||||
|
r502 | name='get_thread'), | ||
|
r542 | url(r'^api/add_post/(?P<opening_post_id>\w+)/$', api.api_add_post, name='add_post'), | ||
|
r500 | |||
|
r137 | ) | ||