def gunicorn(ctx, bind='localhost:8000', workers=13, collectstatic=True):
"""
Starts Gunicorn server. This is not an optimal deployment, since you should
serve static files with a proxy such as nginx. However, Gunicorn is much
more robust than the development server that comes bundled with Django.
"""
if collectstatic:
django_manage('collectstatic')
ctx.run('gunicorn {project_root}.wsgi -b {bind} '
'--workers {workers} '
'--name {project}-server'.format(
project_root=project_root(),
bind=bind,
workers=workers,
project=get_option('options', 'pyname').replace('_', '-')
))
评论列表
文章目录