Skip to content

Usage

Once the app is registered, you serve your project with a single management command.

Terminal window
python manage.py cheroot

This starts Cheroot on http://127.0.0.1:8000, serving your Django WSGI application with the default thread-pool settings. Press Ctrl+C to stop it.

Every argument is optional and has both a short and a long form. Passing none uses the defaults shown below.

ArgumentShortLongTypeDefault
Host IP-ip--hostipstr127.0.0.1
Port-p--portint8000
Max worker threads-w--maxthreadsint40
Min threads in the pool-t--minthreadsint30
Max queued connections-c--connectionsint20

The two commands below are equivalent — they just spell the same defaults with short and long flags:

Terminal window
python manage.py cheroot -ip 127.0.0.1 -p 8000 -w 40 -t 30 -c 20
Terminal window
python manage.py cheroot --hostip 127.0.0.1 --port 8000 --maxthreads 40 --minthreads 30 --connections 20

Bind to all interfaces (so the server is reachable from other machines or containers):

Terminal window
python manage.py cheroot --hostip 0.0.0.0 --port 8000

Run on a different port:

Terminal window
python manage.py cheroot -p 9000

The thread-pool flags map directly onto Cheroot’s wsgi.Server:

  • --minthreadsnumthreads: the minimum number of worker threads kept in the pool.
  • --maxthreadsmax: the maximum number of worker threads Cheroot will spin up under load.
  • --connectionsrequest_queue_size: how many incoming connections may sit in the OS accept queue before new ones are refused.

See Configuration for guidance on choosing values, and Examples for end-to-end recipes.