Error in localeurl example

10 views
Skip to first unread message

jul

unread,
Apr 13, 2010, 3:17:19 PM4/13/10
to django-multilingual
hi,

I'm trying to use this example given in localeurl docs:

**************
{% load i18n %}

<form id="locale_switcher" method="POST" action="{% url
localeurl_change_locale %}">
<select name="language" onchange="$
('#locale_switcher').submit()">
{% for lang in LANGUAGES %}
<option value="{{ lang.0 }}" {% ifequal lang.0
LANGUAGE_CODE %}selected="selected"{% endifequal %}>{{ lang.1 }}</
option>
{% endfor %}
</select>
<noscript>
<input type="submit" value="Set" />
</noscript>
</form>
**************

and get the following error:

"Caught an exception while rendering: Reverse for
'localeurl_change_locale' with arguments '()' and keyword arguments
'{}' not found."

What's wrong?

thanks
jul

Carl Meyer

unread,
Apr 13, 2010, 10:37:49 PM4/13/10
to django-multilingual
Hi jul,

On Apr 13, 3:17 pm, jul <juj...@gmail.com> wrote:
> "Caught an exception while rendering: Reverse for
> 'localeurl_change_locale' with arguments '()' and keyword arguments
> '{}' not found."
>
> What's wrong?

It looks as if you did not follow step 3 in the setup documentation
[1], adding an include for the localeurl urls in your main urls.py.

Carl

[1] http://packages.python.org/django-localeurl/setup.html#setup

Reply all
Reply to author
Forward
0 new messages