Configuration File

The configuration file should be a valid Python source file. It only needs to be readable from the file system. More specifically, it does not need to be importable. Any Python is valid. Just consider that this will be run every time you start Gunicorn (including when you signal Gunicorn to reload).

To set a parameter, just assign to it. There’s no special syntax. The values you provide will be used for the configuration values.

For instance:

  1. import multiprocessing
  2. bind = "127.0.0.1:8000"
  3. workers = multiprocessing.cpu_count() * 2 + 1

All the settings are mentioned in the settings list.