gunicorn/examples/read_django_settings.py
Hugo e974f30517 Drop support for Python 2
Co-Authored-By: Dustin Ingram <di@users.noreply.github.com>
Co-Authored-By: Berker Peksag <berker.peksag@gmail.com>
2018-08-01 15:31:17 +03:00

20 lines
403 B
Python

"""
Use this config file in your script like this:
$ gunicorn project_name.wsgi:application -c read_django_settings.py
"""
settings_dict = {}
with open('frameworks/django/testing/testing/settings.py') as f:
exec(f.read(), settings_dict)
loglevel = 'warning'
proc_name = 'web-project'
workers = 1
if settings_dict['DEBUG']:
loglevel = 'debug'
reload = True
proc_name += '_debug'