Letting the user decide which language to use

While it's not a part of Django, almost all projects that are internationalized use this pattern; thus I think it's important that you are aware of it. Most sites that have multiple language options present the user with a menu to select which language they want to view the site in. Let's create that. Modify the templates/base.html template to match the following:

{% load i18n %}

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

<title>MMDB</title>
</head>
<body>
<h1>MMDB</h1>
<div>
<span>Select Language</span>
<ul>
            {% get_available_languages as available_languages %}
            {% for lang_code, lang_name in available_languages %}
 {% language lang_code %}<li><a href="{% url ...

Get Django Project Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.