Configuring Will

Most of will's configuration is done interactively, using run_will.py, or specifying via the plugins. There are, however a few built-in settings and config worth covering. We'll aim to address all of them here.

Environment variables

All environment variables prefixed with WILL_ are imported into will's settings modules.

In best practices, you should keep all of the following in environment variables:

We've made it easy. No excuses. :)

config.py

Config.py is where all of your non-sensitive settings should go. This includes things like:

More expansive documentation on all of those settings is in config.py, right where you need it.

How environment variables and config.py are combined

The environment variables and config.py are combined, and made available to the rest of the app at:

from will import settings

print settings.MY_SETTING_NAME

The rules for combining are fairly straightforward:

  1. All environment variables that start with WILL_ are imported, and WILL_ is stripped off their name. (i.e. WILL_PORT becomes PORT)
  2. All variables from config.py are imported. If there is a conflict, config.py wins, and a message is displayed:

    Config Conflict

  3. Some smart defaulting happens inside settings.py for important variables. For the moment, I'm going to leave that out of the docs, and refer you to settings.py as I believe things should Just Work, and most people should never need to care. If this decision's wrong, please open an issue, and these docs will be improved!

That's it for config. Now, let's get your will deployed!