##// 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 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 4 from boards import views
5 5 from boards.rss import AllThreadsFeed, TagThreadsFeed, ThreadPostsFeed
@@ -11,6 +11,7 b' from boards.views.search import BoardSea'
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 from boards.views.translation import cached_javascript_catalog
14 15
15 16
16 17 js_info_dict = {
@@ -53,7 +54,7 b" urlpatterns = patterns('',"
53 54 url(r'^thread/(?P<post_id>\d+)/rss/$', ThreadPostsFeed()),
54 55
55 56 # i18n
56 url(r'^jsi18n/$', javascript_catalog, js_info_dict,
57 url(r'^jsi18n/$', cached_javascript_catalog, js_info_dict,
57 58 name='js_info_dict'),
58 59
59 60 # API
General Comments 0
You need to be logged in to leave comments. Login now