When you start working on templates, one of the first actions is to create the base.html
boilerplate, which will be extended by most of the page templates in your project. In this recipe, we will demonstrate how to create such template for multilingual HTML5 websites with responsiveness in mind.
Tip
Responsive websites are the ones that adapt to the viewport of the device whether the visitor uses desktop browsers, tablets, or phones.
In the root directory of your
templates
, create abase.html
file with the following content:{# templates/base.html #} <!DOCTYPE html> {% load i18n %} <html lang="{{ LANGUAGE_CODE }}"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>{% block title %}{% endblock %}{% trans "My Website...