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.
All environment variables prefixed with
WILL_ are imported into will's
In best practices, you should keep all of the following in environment variables:
- Any other tokens, keys, passwords, or sensitive URLS.
We've made it easy. No excuses. :)
Config.py is where all of your non-sensitive settings should go. This includes things like:
PLUGINS: The list of plugins to run,
PLUGIN_BLACKLIST: The list of plugins to ignore, even if they're in
PUBLIC_URL: The publicly accessible URL will can reach himself at (used for keepalive),
HTTPSERVER_PORT: The port will should handle HTTP requests on. Defaults to 80, set to > 1024 if you don't have sudo,
REDIS_MAX_CONNECTIONS: The maximum number of connections to make to redis, for connection pooling.
ROOMS: The list of rooms to join,
DEFAULT_ROOM: The room to send messages that come from web requests to,
TEMPLATE_DIRS: Extra directories to look for templates,
ADMINS: The mention names of all the admins,
LOGLEVEL: What logging level to use,
HIPCHAT_SERVER: if you're using the HipChat server beta, the hostname of the server,
ALLOW_INSECURE_HIPCHAT_SERVER: the option to disable SSL checks (seriously, don't),
PROXY_URL: Proxy server to use, consider exporting it as
WILL_PROXY_URLenvironment variable, if it contains sensitive information
- and all of your non-sensitive plugin settings.
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:
- All environment variables that start with
WILL_are imported, and
WILL_is stripped off their name. (i.e.
All variables from
config.pyare imported. If there is a conflict,
config.pywins, and a message is displayed:
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.pyas 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!