Show More
@@ -1,90 +1,89 b'' | |||
|
1 |
from django.conf.urls import |
|
|
1 | from django.conf.urls import url | |
|
2 | 2 | #from django.views.i18n import javascript_catalog |
|
3 | 3 | |
|
4 | 4 | import neboard |
|
5 | 5 | from boards import views |
|
6 | 6 | from boards.rss import AllThreadsFeed, TagThreadsFeed, ThreadPostsFeed |
|
7 | 7 | from boards.views import api, tag_threads, all_threads, \ |
|
8 | 8 | settings, all_tags, feed |
|
9 | 9 | from boards.views.authors import AuthorsView |
|
10 | 10 | from boards.views.notifications import NotificationView |
|
11 | 11 | from boards.views.static import StaticPageView |
|
12 | 12 | from boards.views.preview import PostPreviewView |
|
13 | 13 | from boards.views.random import RandomImageView |
|
14 | 14 | from boards.views.tag_gallery import TagGalleryView |
|
15 | 15 | from boards.views.translation import cached_javascript_catalog |
|
16 | 16 | |
|
17 | 17 | |
|
18 | 18 | js_info_dict = { |
|
19 | 19 | 'packages': ('boards',), |
|
20 | 20 | } |
|
21 | 21 | |
|
22 |
urlpatterns = |
|
|
22 | urlpatterns = [ | |
|
23 | 23 | # /boards/ |
|
24 | 24 | url(r'^$', all_threads.AllThreadsView.as_view(), name='index'), |
|
25 | 25 | |
|
26 | 26 | # /boards/tag/tag_name/ |
|
27 | 27 | url(r'^tag/(?P<tag_name>\w+)/$', tag_threads.TagView.as_view(), |
|
28 | 28 | name='tag'), |
|
29 | 29 | |
|
30 | 30 | # /boards/thread/ |
|
31 | 31 | url(r'^thread/(?P<post_id>\d+)/$', views.thread.NormalThreadView.as_view(), |
|
32 | 32 | name='thread'), |
|
33 | 33 | url(r'^thread/(?P<post_id>\d+)/mode/gallery/$', views.thread.GalleryThreadView.as_view(), |
|
34 | 34 | name='thread_gallery'), |
|
35 | 35 | url(r'^thread/(?P<post_id>\d+)/mode/tree/$', views.thread.TreeThreadView.as_view(), |
|
36 | 36 | name='thread_tree'), |
|
37 | 37 | # /feed/ |
|
38 | 38 | url(r'^feed/$', views.feed.FeedView.as_view(), name='feed'), |
|
39 | 39 | |
|
40 | 40 | url(r'^settings/$', settings.SettingsView.as_view(), name='settings'), |
|
41 | 41 | url(r'^tags/(?P<query>\w+)?/?$', all_tags.AllTagsView.as_view(), name='tags'), |
|
42 | 42 | url(r'^authors/$', AuthorsView.as_view(), name='authors'), |
|
43 | 43 | |
|
44 | 44 | url(r'^banned/$', views.banned.BannedView.as_view(), name='banned'), |
|
45 | 45 | url(r'^staticpage/(?P<name>\w+)/$', StaticPageView.as_view(), |
|
46 | 46 | name='staticpage'), |
|
47 | 47 | |
|
48 | 48 | url(r'^random/$', RandomImageView.as_view(), name='random'), |
|
49 | 49 | url(r'^tag/(?P<tag_name>\w+)/gallery/$', TagGalleryView.as_view(), name='tag_gallery'), |
|
50 | 50 | |
|
51 | 51 | # RSS feeds |
|
52 | 52 | url(r'^rss/$', AllThreadsFeed()), |
|
53 | 53 | url(r'^page/(?P<page>\d+)/rss/$', AllThreadsFeed()), |
|
54 | 54 | url(r'^tag/(?P<tag_name>\w+)/rss/$', TagThreadsFeed()), |
|
55 | 55 | url(r'^tag/(?P<tag_name>\w+)/page/(?P<page>\w+)/rss/$', TagThreadsFeed()), |
|
56 | 56 | url(r'^thread/(?P<post_id>\d+)/rss/$', ThreadPostsFeed()), |
|
57 | 57 | |
|
58 | 58 | # i18n |
|
59 | 59 | url(r'^jsi18n/$', cached_javascript_catalog, js_info_dict, |
|
60 | 60 | name='js_info_dict'), |
|
61 | 61 | |
|
62 | 62 | # API |
|
63 | 63 | url(r'^api/post/(?P<post_id>\d+)/$', api.get_post, name="get_post"), |
|
64 | 64 | url(r'^api/diff_thread/$', api.api_get_threaddiff, name="get_thread_diff"), |
|
65 | 65 | url(r'^api/threads/(?P<count>\w+)/$', api.api_get_threads, |
|
66 | 66 | name='get_threads'), |
|
67 | 67 | url(r'^api/tags/$', api.api_get_tags, name='get_tags'), |
|
68 | 68 | url(r'^api/thread/(?P<opening_post_id>\w+)/$', api.api_get_thread_posts, |
|
69 | 69 | name='get_thread'), |
|
70 | 70 | url(r'^api/add_post/(?P<opening_post_id>\w+)/$', api.api_add_post, |
|
71 | 71 | name='add_post'), |
|
72 | 72 | url(r'^api/notifications/(?P<username>\w+)/$', api.api_get_notifications, |
|
73 | 73 | name='api_notifications'), |
|
74 | 74 | url(r'^api/preview/$', api.api_get_preview, name='preview'), |
|
75 | 75 | url(r'^api/new_posts/$', api.api_get_new_posts, name='new_posts'), |
|
76 | 76 | |
|
77 | 77 | # Notifications |
|
78 | 78 | url(r'^notifications/(?P<username>\w+)/$', NotificationView.as_view(), name='notifications'), |
|
79 | 79 | url(r'^notifications/$', NotificationView.as_view(), name='notifications'), |
|
80 | 80 | |
|
81 | 81 | # Post preview |
|
82 | url(r'^preview/$', PostPreviewView.as_view(), name='preview') | |
|
83 | ||
|
84 | ) | |
|
82 | url(r'^preview/$', PostPreviewView.as_view(), name='preview'), | |
|
83 | ] | |
|
85 | 84 | |
|
86 | 85 | # Search |
|
87 | 86 | if 'haystack' in neboard.settings.INSTALLED_APPS: |
|
88 | 87 | from boards.views.search import BoardSearchView |
|
89 | 88 | urlpatterns.append(url(r'^search/$', BoardSearchView.as_view(), name='search')) |
|
90 | 89 |
@@ -1,20 +1,20 b'' | |||
|
1 |
from django.conf.urls import |
|
|
1 | from django.conf.urls import include, url | |
|
2 | 2 | |
|
3 | 3 | # Uncomment the next two lines to enable the admin: |
|
4 | 4 | from django.conf.urls.static import static |
|
5 | 5 | from django.contrib import admin |
|
6 | 6 | from neboard import settings |
|
7 | 7 | |
|
8 | 8 | from boards.views.not_found import NotFoundView |
|
9 | 9 | |
|
10 | 10 | admin.autodiscover() |
|
11 | 11 | |
|
12 |
urlpatterns = |
|
|
12 | urlpatterns = [ | |
|
13 | 13 | # Uncomment the admin/doc line below to enable admin documentation: |
|
14 | 14 | # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), |
|
15 | 15 | |
|
16 | 16 | url(r'^admin/', include(admin.site.urls), name='admin'), |
|
17 | 17 | url(r'^', include('boards.urls')), |
|
18 |
|
|
|
18 | ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) | |
|
19 | 19 | |
|
20 | 20 | handler404 = NotFoundView.as_view() |
General Comments 0
You need to be logged in to leave comments.
Login now