##// END OF EJS Templates
Cache javascript translations
neko259 -
r1393:22dd8fd4 default
parent child Browse files
Show More
@@ -0,0 +1,7 b''
1 from django.views.decorators.cache import cache_page
2 from django.views.i18n import javascript_catalog
3
4 @cache_page(600)
5 def cached_javascript_catalog(request, domain='djangojs', packages=None):
6 return javascript_catalog(request, domain, packages)
7
@@ -1,5 +1,5 b''
1 from django.conf.urls import patterns, url
1 from django.conf.urls import patterns, url
2 from django.views.i18n import javascript_catalog
2 #from django.views.i18n import javascript_catalog
3
3
4 from boards import views
4 from boards import views
5 from boards.rss import AllThreadsFeed, TagThreadsFeed, ThreadPostsFeed
5 from boards.rss import AllThreadsFeed, TagThreadsFeed, ThreadPostsFeed
@@ -11,6 +11,7 b' from boards.views.search import BoardSea'
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.translation import cached_javascript_catalog
14
15
15
16
16 js_info_dict = {
17 js_info_dict = {
@@ -53,7 +54,7 b" urlpatterns = patterns('',"
53 url(r'^thread/(?P<post_id>\d+)/rss/$', ThreadPostsFeed()),
54 url(r'^thread/(?P<post_id>\d+)/rss/$', ThreadPostsFeed()),
54
55
55 # i18n
56 # i18n
56 url(r'^jsi18n/$', javascript_catalog, js_info_dict,
57 url(r'^jsi18n/$', cached_javascript_catalog, js_info_dict,
57 name='js_info_dict'),
58 name='js_info_dict'),
58
59
59 # API
60 # API
General Comments 0
You need to be logged in to leave comments. Login now