Arranging the base.html template

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.

Getting ready

Create the templates directory in your project and set TEMPLATE_DIRS in the settings.

How to do it…

Perform the following steps:

  1. In the root directory of your templates, create a base.html file with the following content:
    {# templates/base.html #} <!DOCTYPE html> {% load i18n ...

Get Django: Web Development with Python 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.