Skip to Content
Django 3 Web Development Cookbook - Fourth Edition
book

Django 3 Web Development Cookbook - Fourth Edition

by Aidas Bendoraitis, Jake Kronika
March 2020
Intermediate to advanced
608 pages
17h 17m
English
Packt Publishing
Content preview from Django 3 Web Development Cookbook - Fourth Edition

How it works...

If you run a Django management command without the environment variable set, you will see an error raised with a message, such as Set the DJANGO_SECRET_KEY environment variable.

You can set the environment variables in the PyCharm configuration, remote server configuration consoles, in the env/bin/activate script, .bash_profile, or directly in the Terminal like this:

$ export DJANGO_SECRET_KEY="change-this-to-50-characters-long-random-  string"$ export DATABASE_NAME="myproject"$ export DATABASE_USER="myproject"$ export DATABASE_PASSWORD="change-this-to-database-password"

Note that you should use the get_secret() function for all passwords, API keys, and any other sensitive information that you need in your Django project configuration. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Django 2 Web Development Cookbook - Third Edition

Django 2 Web Development Cookbook - Third Edition

Jake Kronika, Aidas Bendoraitis

Publisher Resources

ISBN: 9781838987428Supplemental Content