def gunicorn(ctx, exec=True):
"""
Starts Gunicorn application server.
"""
if exec:
wsgi_application = os.environ['WSGI_APPLICATION']
sock = 'unix:/tmp/gunicorn.sock'
os.execlp('gunicorn', '-b', sock, wsgi_application, '--reload')
else:
cmd = 'gunicorn $WSGI_APPLICATION -b unix:/tmp/webapp.sock --reload'
ctx.run(cmd, pty=True)
评论列表
文章目录