Skip to main content

Configure uWSGI from your Python code

Project description

release stats lic ci coverage

Work in progress. Stay tuned.


Configure uWSGI from your Python code

If you think you know uWSGI you’re probably wrong. It is always more than you think it is. There are so many subsystems and options (800+) it is difficult to even try to wrap your mind around.

uwsgiconf allowing to define uWSGI configurations in Python tries to improve things the following ways:

  • It structures options for various subsystems using classes and methods;

  • It uses docstrings and sane naming to facilitate navigation;

  • It ships some useful presets to reduce boilerplate code;

Consider using IDE with autocompletion and docstings support to be more productive with uwsgiconf.

By that time you already know that uwsgiconf is just another configuration method. Why?


Two main strategies to use uwsgiconf:

  1. Static: create configuration .py and compile it on demand into classic uWSGI .ini using provided methods.

  2. Dynamic: create configuration .py, make it executable and give it directly to uWSGI

uwsgi --ini 'exec://path/to/'

A taste of it

Let’s make, enable its execution (-x permission and #!).

There we configure it using nice PythonSection preset to run our web app.

#! /usr/bin/env python3
from uwsgiconf.presets.nice import PythonSection

    # Reload uWSGI when this file is updated.


    # Load module from myapp package.

    # Make app available at


Now we are ready to use this configuration dynamically (see Strategies paragraph above).


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uwsgiconf-0.2.0.tar.gz (69.2 kB view hashes)

Uploaded source

Built Distribution

uwsgiconf-0.2.0-py2.py3-none-any.whl (76.7 kB view hashes)

Uploaded 2 7

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page