Describing a Configuration File
- There is a list of settings for Gunicorn
- Some of these settings are only usable in a configuration file
- Some of these settings have CLI counterparts as well
- They can be specified using environment variable
GUNICORN_CMD_ARGS - The following is an example including
--bind:
$ GUNICORN_CMD_ARGS="--bind=127.0.0.1" gunicorn app:appDescribing the config Setting
-
The setting in the configuration file is:
config
-
The setting in the CLI can be:
- c CONFIG`
- Or
--config CONFIG
- This setting specifies a Gunicorn config file
-
The
CONFIGfile can be formatted as any of the following:PATHfile:PATHpython:MODULE_NAME
- The config gile can be a
.pyor.inifile
Example of the config Setting
- A
.pyconfiguration file can be defined as:
# config.py
>>> timeout = 120- We can specify it using the
-cflag:
$ gunicorn -c config.py ...- Or we can specify the
timeoutsetting using the CLI:
$ gunicorn --timeout 120 ...References
Previous
Next