Book Image

Django 1.0 Template Development

Book Image

Django 1.0 Template Development

Overview of this book

Table of Contents (17 chapters)
Django 1.0 Template Development
Credits
About the Author
About the Reviewers
Preface
Index

Configuring the template system


There are a number of configuration settings for your mycomapny/settings.py file, but there are only four main ones we need to work out with to configure the Django template system: DEBUG, TEMPLATE_DEBUG, TEMPLATE_LOADERS, and TEMPLATE_DIRS.

DEBUG

The DEBUG setting tells Django to run in debugging mode, enabling diagnostic information to be displayed in the browser when errors occur. These error messages can be very helpful for tracking down errors and bugs.

Here's how it should look in your mycompany/settings.py file:

DEBUG = True
TEMPLATE_DEBUG = True

When debugging is turned off, errors will be displayed using a friendly error template instead of showing the diagnostic information that you wouldn't want general users to see. By default, Django hides the most sensitive settings. But there are still bits of information you probably don't want the users to see.

Here's an example of debugging output:

Note

Caution: DEBUG also controls extra SQL logging and it can...