gorgeous-eve-12553
08/01/2020, 7:11 PMgunicorn main:app (Pants 2.0)happy-kitchen-89482
08/03/2020, 4:37 AMminiature-lamp-45970
08/04/2020, 10:41 PMminiature-lamp-45970
08/04/2020, 11:19 PMhappy-kitchen-89482
08/04/2020, 11:32 PMpython_binary(
name = 'foo-gunicorn',
entry_point = foo.gunicorn_main',
zip_safe=False,
dependencies = [...],
)
And foo/gunicorn_main.py is a wrapper around the gunicorn entry point that sets up Django and injects the gunicorn config.happy-kitchen-89482
08/04/2020, 11:33 PMgunicorn.app.wsgiapp.WSGIApplication.run()happy-kitchen-89482
08/04/2020, 11:35 PMWSGIApplication and implement load_config() to call self.load_config_from_file(conf_path) where conf_path points to the config for specific app we're running.happy-kitchen-89482
08/04/2020, 11:35 PMminiature-lamp-45970
08/05/2020, 12:09 AMminiature-lamp-45970
08/05/2020, 1:14 AMhappy-kitchen-89482
08/05/2020, 2:13 AMif __name__ == "__main__":
CustomGunicornService.from_file_name(__file__).run_gunicorn()happy-kitchen-89482
08/05/2020, 2:14 AMfrom_file_name() uses that arg to figure out who ran it, and construct an appropriate reference to a config file.