29.2.6 Checking Our Production Settings

We saw in passing in Chapter 3 that Django (as of version 1.7) supplies a check management command. The command acts as a method to supply a specific kind of test to our project. Powerfully, the check framework allows for checks to apply to specific portions of the project. There is an entire section of checks dedicated to deployment.

We set appropriate environment settings in Example 29.32.

Example 29.32: Shell Code

$ export SECRET_KEY='8$2(j1asy+2t113v%7%#qdntydt_@voxs3rz#7)&2u+66i!y0f' $ export DJANGO_SETTINGS_MODULE=suorganizer.settings.production

We can then use the the check command with the deploy flag, as shown in Example 29.33.

Example 29.33: Shell Code

./manage.py ...

Get Django Unleashed 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.