Skip to content

Commit

Permalink
Correction on default value for config file (benoitc#2408)
Browse files Browse the repository at this point in the history
Running gunicorn project.app while having a file called gunicorn.conf.py
in the current directory will read configuration from that file and actually fail
if the file raises an exception.
  • Loading branch information
avilaton authored Aug 22, 2020
1 parent 5001de6 commit b80a329
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion docs/source/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ config
~~~~~~

* ``-c CONFIG, --config CONFIG``
* ``None``
* ``./gunicorn.conf.py``

The Gunicorn config file.

Expand All @@ -38,6 +38,9 @@ A string of the form ``PATH``, ``file:PATH``, or ``python:MODULE_NAME``.
Only has an effect when specified on the command line or as part of an
application specific configuration.

By default, a file named ``gunicorn.conf.py`` will be read from the same
directory where gunicorn is being run.

.. versionchanged:: 19.4
Loading the config from a Python module requires the ``python:``
prefix.
Expand Down
5 changes: 4 additions & 1 deletion gunicorn/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ class ConfigFile(Setting):
cli = ["-c", "--config"]
meta = "CONFIG"
validator = validate_string
default = None
default = "./gunicorn.conf.py"
desc = """\
The Gunicorn config file.
Expand All @@ -555,6 +555,9 @@ class ConfigFile(Setting):
Only has an effect when specified on the command line or as part of an
application specific configuration.
By default, a file named ``gunicorn.conf.py`` will be read from the same
directory where gunicorn is being run.
.. versionchanged:: 19.4
Loading the config from a Python module requires the ``python:``
prefix.
Expand Down

0 comments on commit b80a329

Please sign in to comment.