Show More
@@ -1,4 +1,4 b'' | |||||
1 | import re |
|
1 | import re | |
2 |
|
2 | |||
3 | FILE_DIRECTORY = 'files/' |
|
3 | FILE_DIRECTORY = 'files/' | |
4 | REGEX_TAGS = re.compile(r'^[\w\s\d]+$', re.UNICODE) |
|
4 | REGEX_TAGS = re.compile(r'^[\w\s\d\']+$', re.UNICODE) |
@@ -1,96 +1,96 b'' | |||||
1 | from django.conf.urls import url |
|
1 | from django.conf.urls import url | |
2 |
|
2 | |||
3 | from boards import views |
|
3 | from boards import views | |
4 | from boards.rss import AllThreadsFeed, TagThreadsFeed, ThreadPostsFeed |
|
4 | from boards.rss import AllThreadsFeed, TagThreadsFeed, ThreadPostsFeed | |
5 | from boards.views import api, tag_threads, all_threads, settings, feed, stickers |
|
5 | from boards.views import api, tag_threads, all_threads, settings, feed, stickers | |
6 | from boards.views.authors import AuthorsView |
|
6 | from boards.views.authors import AuthorsView | |
7 | from boards.views.landing import LandingView |
|
7 | from boards.views.landing import LandingView | |
8 | from boards.views.notifications import NotificationView |
|
8 | from boards.views.notifications import NotificationView | |
9 | from boards.views.preview import PostPreviewView |
|
9 | from boards.views.preview import PostPreviewView | |
10 | from boards.views.random import RandomImageView |
|
10 | from boards.views.random import RandomImageView | |
11 | from boards.views.search import BoardSearchView |
|
11 | from boards.views.search import BoardSearchView | |
12 | from boards.views.static import StaticPageView |
|
12 | from boards.views.static import StaticPageView | |
13 | from boards.views.sync import get_post_sync_data, response_get, response_list |
|
13 | from boards.views.sync import get_post_sync_data, response_get, response_list | |
14 | from boards.views.tag_gallery import TagGalleryView |
|
14 | from boards.views.tag_gallery import TagGalleryView | |
15 | from boards.views.translation import cached_javascript_catalog |
|
15 | from boards.views.translation import cached_javascript_catalog | |
16 | from boards.views.utils import UtilsView |
|
16 | from boards.views.utils import UtilsView | |
17 |
|
17 | |||
18 | js_info_dict = { |
|
18 | js_info_dict = { | |
19 | 'packages': ('boards',), |
|
19 | 'packages': ('boards',), | |
20 | } |
|
20 | } | |
21 |
|
21 | |||
22 | urlpatterns = [ |
|
22 | urlpatterns = [ | |
23 | # /boards/ |
|
23 | # /boards/ | |
24 | url(r'^all/$', all_threads.AllThreadsView.as_view(), name='index'), |
|
24 | url(r'^all/$', all_threads.AllThreadsView.as_view(), name='index'), | |
25 |
|
25 | |||
26 | # /boards/tag/tag_name/ |
|
26 | # /boards/tag/tag_name/ | |
27 | url(r'^tag/(?P<tag_name>\w+)/$', tag_threads.TagView.as_view(), |
|
27 | url(r'^tag/(?P<tag_name>[\w\d\']+)/$', tag_threads.TagView.as_view(), | |
28 | name='tag'), |
|
28 | name='tag'), | |
|
29 | url(r'^tag/(?P<tag_name>[\w\d\']+)/gallery/$', TagGalleryView.as_view(), name='tag_gallery'), | |||
29 |
|
30 | |||
30 | # /boards/thread/ |
|
31 | # /boards/thread/ | |
31 | url(r'^thread/(?P<post_id>\d+)/$', views.thread.NormalThreadView.as_view(), |
|
32 | url(r'^thread/(?P<post_id>\d+)/$', views.thread.NormalThreadView.as_view(), | |
32 | name='thread'), |
|
33 | name='thread'), | |
33 | url(r'^thread/(?P<post_id>\d+)/mode/gallery/$', views.thread.GalleryThreadView.as_view(), |
|
34 | url(r'^thread/(?P<post_id>\d+)/mode/gallery/$', views.thread.GalleryThreadView.as_view(), | |
34 | name='thread_gallery'), |
|
35 | name='thread_gallery'), | |
35 | url(r'^thread/(?P<post_id>\d+)/mode/tree/$', views.thread.TreeThreadView.as_view(), |
|
36 | url(r'^thread/(?P<post_id>\d+)/mode/tree/$', views.thread.TreeThreadView.as_view(), | |
36 | name='thread_tree'), |
|
37 | name='thread_tree'), | |
37 | # /feed/ |
|
38 | # /feed/ | |
38 | url(r'^feed/$', views.feed.FeedView.as_view(), name='feed'), |
|
39 | url(r'^feed/$', views.feed.FeedView.as_view(), name='feed'), | |
39 |
|
40 | |||
40 | url(r'^settings/$', settings.SettingsView.as_view(), name='settings'), |
|
41 | url(r'^settings/$', settings.SettingsView.as_view(), name='settings'), | |
41 | url(r'^stickers/$', stickers.AliasesView.as_view(), name='stickers'), |
|
42 | url(r'^stickers/$', stickers.AliasesView.as_view(), name='stickers'), | |
42 | url(r'^stickers/(?P<category>\w+)/$', stickers.AliasesView.as_view(), name='stickers'), |
|
43 | url(r'^stickers/(?P<category>\w+)/$', stickers.AliasesView.as_view(), name='stickers'), | |
43 | url(r'^authors/$', AuthorsView.as_view(), name='authors'), |
|
44 | url(r'^authors/$', AuthorsView.as_view(), name='authors'), | |
44 |
|
45 | |||
45 | url(r'^banned/$', views.banned.BannedView.as_view(), name='banned'), |
|
46 | url(r'^banned/$', views.banned.BannedView.as_view(), name='banned'), | |
46 | url(r'^staticpage/(?P<name>\w+)/$', StaticPageView.as_view(), |
|
47 | url(r'^staticpage/(?P<name>\w+)/$', StaticPageView.as_view(), | |
47 | name='staticpage'), |
|
48 | name='staticpage'), | |
48 |
|
49 | |||
49 | url(r'^random/$', RandomImageView.as_view(), name='random'), |
|
50 | url(r'^random/$', RandomImageView.as_view(), name='random'), | |
50 | url(r'^tag/(?P<tag_name>\w+)/gallery/$', TagGalleryView.as_view(), name='tag_gallery'), |
|
|||
51 | url(r'^search/$', BoardSearchView.as_view(), name='search'), |
|
51 | url(r'^search/$', BoardSearchView.as_view(), name='search'), | |
52 | url(r'^$', LandingView.as_view(), name='landing'), |
|
52 | url(r'^$', LandingView.as_view(), name='landing'), | |
53 | url(r'^utils$', UtilsView.as_view(), name='utils'), |
|
53 | url(r'^utils$', UtilsView.as_view(), name='utils'), | |
54 |
|
54 | |||
55 | # RSS feeds |
|
55 | # RSS feeds | |
56 | url(r'^rss/$', AllThreadsFeed()), |
|
56 | url(r'^rss/$', AllThreadsFeed()), | |
57 | url(r'^all/rss/$', AllThreadsFeed()), |
|
57 | url(r'^all/rss/$', AllThreadsFeed()), | |
58 | url(r'^page/(?P<page>\d+)/rss/$', AllThreadsFeed()), |
|
58 | url(r'^page/(?P<page>\d+)/rss/$', AllThreadsFeed()), | |
59 | url(r'^tag/(?P<tag_name>\w+)/rss/$', TagThreadsFeed()), |
|
59 | url(r'^tag/(?P<tag_name>\w+)/rss/$', TagThreadsFeed()), | |
60 | url(r'^tag/(?P<tag_name>\w+)/page/(?P<page>\w+)/rss/$', TagThreadsFeed()), |
|
60 | url(r'^tag/(?P<tag_name>\w+)/page/(?P<page>\w+)/rss/$', TagThreadsFeed()), | |
61 | url(r'^thread/(?P<post_id>\d+)/rss/$', ThreadPostsFeed()), |
|
61 | url(r'^thread/(?P<post_id>\d+)/rss/$', ThreadPostsFeed()), | |
62 |
|
62 | |||
63 | # i18n |
|
63 | # i18n | |
64 | url(r'^jsi18n/$', cached_javascript_catalog, js_info_dict, |
|
64 | url(r'^jsi18n/$', cached_javascript_catalog, js_info_dict, | |
65 | name='js_info_dict'), |
|
65 | name='js_info_dict'), | |
66 |
|
66 | |||
67 | # API |
|
67 | # API | |
68 | url(r'^api/post/(?P<post_id>\d+)/$', api.get_post, name="get_post"), |
|
68 | url(r'^api/post/(?P<post_id>\d+)/$', api.get_post, name="get_post"), | |
69 | url(r'^api/diff_thread/$', api.api_get_threaddiff, name="get_thread_diff"), |
|
69 | url(r'^api/diff_thread/$', api.api_get_threaddiff, name="get_thread_diff"), | |
70 | url(r'^api/threads/(?P<count>\w+)/$', api.api_get_threads, |
|
70 | url(r'^api/threads/(?P<count>\w+)/$', api.api_get_threads, | |
71 | name='get_threads'), |
|
71 | name='get_threads'), | |
72 | url(r'^api/tags/$', api.api_get_tags, name='get_tags'), |
|
72 | url(r'^api/tags/$', api.api_get_tags, name='get_tags'), | |
73 | url(r'^api/thread/(?P<opening_post_id>\w+)/$', api.api_get_thread_posts, |
|
73 | url(r'^api/thread/(?P<opening_post_id>\w+)/$', api.api_get_thread_posts, | |
74 | name='get_thread'), |
|
74 | name='get_thread'), | |
75 | url(r'^api/add_post/(?P<opening_post_id>\w+)/$', api.api_add_post, |
|
75 | url(r'^api/add_post/(?P<opening_post_id>\w+)/$', api.api_add_post, | |
76 | name='add_post'), |
|
76 | name='add_post'), | |
77 | url(r'^api/notifications/(?P<username>\w+)/$', api.api_get_notifications, |
|
77 | url(r'^api/notifications/(?P<username>\w+)/$', api.api_get_notifications, | |
78 | name='api_notifications'), |
|
78 | name='api_notifications'), | |
79 | url(r'^api/preview/$', api.api_get_preview, name='preview'), |
|
79 | url(r'^api/preview/$', api.api_get_preview, name='preview'), | |
80 | url(r'^api/new_posts/$', api.api_get_new_posts, name='new_posts'), |
|
80 | url(r'^api/new_posts/$', api.api_get_new_posts, name='new_posts'), | |
81 | url(r'^api/stickers/$', api.api_get_stickers, name='get_stickers'), |
|
81 | url(r'^api/stickers/$', api.api_get_stickers, name='get_stickers'), | |
82 |
|
82 | |||
83 | # Sync protocol API |
|
83 | # Sync protocol API | |
84 | url(r'^api/sync/list/$', response_list, name='api_sync_list'), |
|
84 | url(r'^api/sync/list/$', response_list, name='api_sync_list'), | |
85 | url(r'^api/sync/get/$', response_get, name='api_sync_get'), |
|
85 | url(r'^api/sync/get/$', response_get, name='api_sync_get'), | |
86 |
|
86 | |||
87 | # Notifications |
|
87 | # Notifications | |
88 | url(r'^notifications/(?P<username>\w+)/$', NotificationView.as_view(), name='notifications'), |
|
88 | url(r'^notifications/(?P<username>\w+)/$', NotificationView.as_view(), name='notifications'), | |
89 | url(r'^notifications/$', NotificationView.as_view(), name='notifications'), |
|
89 | url(r'^notifications/$', NotificationView.as_view(), name='notifications'), | |
90 |
|
90 | |||
91 | # Post preview |
|
91 | # Post preview | |
92 | url(r'^preview/$', PostPreviewView.as_view(), name='preview'), |
|
92 | url(r'^preview/$', PostPreviewView.as_view(), name='preview'), | |
93 | url(r'^post_xml/(?P<post_id>\d+)$', get_post_sync_data, |
|
93 | url(r'^post_xml/(?P<post_id>\d+)$', get_post_sync_data, | |
94 | name='post_sync_data'), |
|
94 | name='post_sync_data'), | |
95 | ] |
|
95 | ] | |
96 |
|
96 |
General Comments 0
You need to be logged in to leave comments.
Login now