web2py_config.py - gunicorn configuration for web2py / the Runestone Server

This file configures gunicorn to run the web2py-based (old) Runestone Server.

See also the gunicorn config docs.

Imports

These are listed in the order prescribed by `PEP 8`_.

Standard library

import multiprocessing
import os
 

Third-party imports

None.

Local application imports

from common_config import *
 
 

Configuration

chdir: Change directory to specified directory before loading apps. Point this to the location of wsgihandler.py, which must be copied to the web2py root directory.

chdir = os.environ["WEB2PY_PATH"]
 

wsgi_app: A WSGI application path in pattern $(MODULE_NAME):$(VARIABLE_NAME).

wsgi_app = "wsgihandler:application"
 

workers: The number of worker processes for handling requests. Pick this based on CPU count.

workers = multiprocessing.cpu_count()
 

bind: The socket to bind. This must match the socket nginx sends to.

bind = "unix:/run/web2py.sock"