User Tools

Site Tools


язык_программирования_python

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
язык_программирования_python [2026/03/17 14:17]
val [Flask Gunicorn]
язык_программирования_python [2026/03/20 09:13] (current)
val [Flask Gunicorn]
Line 121: Line 121:
 (venv1) :~/pywebd$ #pip install gunicorn (venv1) :~/pywebd$ #pip install gunicorn
 (venv1) :~/pywebd$ #gunicorn app:app --bind 0.0.0.0:​8000 (venv1) :~/pywebd$ #gunicorn app:app --bind 0.0.0.0:​8000
 +(venv1) :~/pywebd$ #cat gunicorn.conf.py
 +</​code><​code>​
 +import os
 +import configparser
 +
 +myconfig = configparser.ConfigParser()
 +myconfig.read('/​etc/​pywebd/​pywebd.conf'​)
 +
 +if '​PYWEBD_PORT'​ in os.environ: pywebd_port = os.environ.get('​PYWEBD_PORT'​)
 +else: pywebd_port = myconfig['​default'​]['​Listen'​]
 +
 +#certfile = "/​etc/​pywebd/​pywebd.crt"​
 +#keyfile = "/​etc/​pywebd/​pywebd.key"​
 +
 +bind = '​0.0.0.0:'​ + pywebd_port
 +</​code><​code>​
 +(venv1) :~/pywebd$ # gunicorn -c gunicorn.conf.py app:app
 </​code>​ </​code>​
  
язык_программирования_python.1773746229.txt.gz · Last modified: 2026/03/17 14:17 by val