Checking for missing settings

Since Django 1.7, you can use an extensible System Check Framework, which replaces the old validate management command. In this recipe, you will learn how to create a check if the ADMINS setting is set. Similarly, you will be able to check whether different secret keys or access tokens are set for the APIs that you are using.

Getting ready

Let's start with the viral_videos app that we created in the Using database query expressions recipe and extended in the previous recipe.

How to do it...

To use System Check Framework, follow these simple steps:

  1. Create the checks.py file with the following content:
    # viral_videos/checks.py # -*- coding: UTF-8 -*- from __future__ import unicode_literals from django.core.checks import ...

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.