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