I'm currently using django 1.3 for my project. I'm working on the localization of the project. I'm able to localize the python code and templates, but I'm having trouble with the javascript localization. I'm getting TemplateSyntaxError message saying that "Caught NoReverseMatch while rendering: Reverse for ''django.views.i18n.javascript_catalog'' with arguments '()' and keyword arguments '{}' not found." I put the part of my url.py and the template home.html codes below. I checked django.views.i18n.javascript_catalog using python manage.py shell which is fine.
Can you tell me what I'm doing wrong?
Shouldn't url function in the template result in http:///jsi18n/?
Thanks!
Min
=== urls.py ===
js_info_dict = {
'domain': 'djangojs',
'packages': ('messages',),
}
urlpatterns = patterns('',
url(r'^$', 'messages.views.home', name='home'),
url(r'^messages/$', include('messages.urls')),
# Localization
url(r'^i18n/', include('django.conf.urls.i18n')),
url(r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict),
)
=== end ===
=== home.html ===
<body>
<script type="text/javascript" src="{% url 'django.views.i18n.javascript_catalog' %}"></script>
</body>
=== end ===