Mercurial > p > roundup > code
comparison doc/installation.txt @ 8399:036ba3496232
doc: add waitress wsgi serve docs
Waitress is a pure python wsgi server. Seems to work under windows.
Added doc that worked for me to spin up a wsgi.py file with
waitress in a venv.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Wed, 16 Jul 2025 20:00:07 -0400 |
| parents | d94bba15b65e |
| children | 1522e0e15903 |
comparison
equal
deleted
inserted
replaced
| 8398:b976dd2beb1a | 8399:036ba3496232 |
|---|---|
| 1440 nginx configuration below. | 1440 nginx configuration below. |
| 1441 | 1441 |
| 1442 If you are customizing a docker continer to use gunicorn, see | 1442 If you are customizing a docker continer to use gunicorn, see |
| 1443 https://pythonspeed.com/articles/gunicorn-in-docker/. | 1443 https://pythonspeed.com/articles/gunicorn-in-docker/. |
| 1444 | 1444 |
| 1445 .. index:: pair: web interface; Waitress | |
| 1446 single: wsgi; Waitress | |
| 1447 | |
| 1448 Waitress Installation | |
| 1449 ~~~~~~~~~~~~~~~~~~~~~ | |
| 1450 | |
| 1451 Waitress is a pure Python WSGI server. It runs on Windows and you | |
| 1452 could use IIS or other web server to reverse proxy HTTP to it. | |
| 1453 | |
| 1454 You can use Waitress to serve Roundup without a proxy. It's not | |
| 1455 recommended, but it can be used on a local network where roundup can't | |
| 1456 be accessed from the internet. | |
| 1457 | |
| 1458 Assuming you have installed Roundup in a virtual environment (venv), | |
| 1459 install ``waitress`` and ``paste`` into the same venv using | |
| 1460 pip. ``paste`` is optional, but it provides logging middleware that | |
| 1461 produces standard combined format HTTP connection logs. You need to | |
| 1462 modify the file wsgi.py (obtained from ``frontends/wsgi.py``) to | |
| 1463 invoke waitress. It will look like:: | |
| 1464 | |
| 1465 # If you installed roundup to the system locations | |
| 1466 # using pip you don't need to change this | |
| 1467 # section. If you installed roundup in a custom | |
| 1468 # location, uncomment these lines and change the | |
| 1469 # path in the append() method to your custom path. | |
| 1470 #import sys | |
| 1471 #sys.path.append('/custom/location/where/roundup/is/installed') | |
| 1472 | |
| 1473 # Obtain the WSGI request dispatcher | |
| 1474 from roundup.cgi.wsgi_handler import RequestDispatcher | |
| 1475 | |
| 1476 # Set the path to tracker home. | |
| 1477 tracker_home = 'demo' | |
| 1478 | |
| 1479 # Definition signature for app: app(environ, start_response): | |
| 1480 # If using apache mod_wsgi change app to application. | |
| 1481 app = RequestDispatcher(tracker_home) | |
| 1482 | |
| 1483 from waitress import serve | |
| 1484 # Optional replaced TransLogger(app) with app if not installed | |
| 1485 from paste.translogger import TransLogger | |
| 1486 serve(TransLogger(app), | |
| 1487 host='0.0.0.0', | |
| 1488 port=8917, | |
| 1489 url_prefix=f"/{tracker_home}/") | |
| 1490 | |
| 1491 This will make Roundup available to any host on your local network at | |
| 1492 port 8917 under the ``/demo/`` path. Run it with ``python wsgi.py``. | |
| 1493 If you want to run just on the local loopback interface, replace | |
| 1494 ``0.0.0.0`` with ``127.0.0.1`` | |
| 1495 | |
| 1496 `See the Waitress docs`_ for more info on configuring waitress | |
| 1497 including putting it behind a proxy, IPV6 support etc. | |
| 1498 | |
| 1499 .. _`See the Waitress docs`: | |
| 1500 https://docs.pylonsproject.org/projects/waitress/en/stable/ | |
| 1501 | |
| 1445 .. index:: pair: web interface; uWSGI | 1502 .. index:: pair: web interface; uWSGI |
| 1446 single: wsgi; uWSGI | 1503 single: wsgi; uWSGI |
| 1447 | 1504 |
| 1448 uWSGI Installation | 1505 uWSGI Installation |
| 1449 ~~~~~~~~~~~~~~~~~~ | 1506 ~~~~~~~~~~~~~~~~~~ |
