Hello. I switch language in my app with built-in view set_language. It works on my local machine but it doesn't work here. Code from my template:
<form action="{% url 'set_language' %}" method="post">{% csrf_token %}
<input name="next" type="hidden" value="{{ redirect_to }}" />
<select name="language" id="language">
{% get_current_language as LANGUAGE_CODE %}
{% get_available_languages as LANGUAGES %}
{% get_language_info_list for LANGUAGES as languages %}
{% for language in languages %}
<option value="{{ language.code }}"{% if language.code == LANGUAGE_CODE %} selected="selected"{% endif %}>
{{ language.name_local }} ({{ language.code }})
</option>
{% endfor %}
</select>
</form>
And I have this in my settings, because I need only 2 languages:
LANGUAGES = [
('en', _('English')),
('ru', _('Russian')),
]
Also, I noticed that with this form I can switch language in Django Admin.