gunicorn文档中提到了编辑配置文件,但我不知道它在哪里。
答案可能很简单:)我在Amazon Linux AMI上。
发布于 2012-11-12 17:03:17
答案就在gunicorn的文档中。http://docs.gunicorn.org/en/latest/configure.html
您可以使用.ini或python脚本指定配置文件。
例如,来自django-skel项目
"""gunicorn WSGI server configuration."""
from multiprocessing import cpu_count
from os import environ
def max_workers():
return cpu_count()
bind = '0.0.0.0:' + environ.get('PORT', '8000')
max_requests = 1000
worker_class = 'gevent'
workers = max_workers()并且您可以使用以下命令运行服务器
gunicorn -c gunicorn.py.ini project.wsgi请注意,project.wsgi对应于您的wsgi的位置。
发布于 2017-03-23 19:59:22
这里有一个示例文件:https://github.com/benoitc/gunicorn/blob/master/examples/example_config.py
你可以注释掉你不需要的东西,然后像这样指向Gunicorn:
gunicorn -c config.py myproject:app发布于 2018-11-23 21:49:06
就默认名称而言,Gunicorn将查找名为gunicorn.conf.py in the directory where Gunicorn is executed的配置文件
https://stackoverflow.com/questions/12063463
复制相似问题