skip to navigation
skip to content

uwsgiconf 0.8.0

Configure uWSGI from your Python code

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;
  • It encourages configuration reuse;
  • It comes with CLI to facilitate configuration;
  • It features easy to use and documented uwsgi stub Python module.

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?

Usage Strategies

Two main strategies to use uwsgiconf:

  1. Static: create configuration .py and compile it when you like into classic uWSGI .ini using provided methods.
  2. Dynamic: create configuration .py, and give it directly to uWSGI with exec directive.

uwsgiconf CLI has tools to streamline both of these.

A taste of it

Let’s make There we configure it using nice PythonSection preset to run our web app.

from uwsgiconf.presets.nice import PythonSection

configuration = PythonSection(
    # Load module containing WSGI application.

    # Make app available at


  1. Now if you want to generate myconf.ini file and use it for uWSGI you can do it with:

    $ python > myconf.ini
    ; or just
    $ uwsgiconf compile > myconf.ini
    $ uwsgi myconf.ini
  2. Or for dynamic usage of .py:

    $ uwsgi --ini "exec://python"
    ; or just
    $ uwsgiconf run
File Type Py Version Uploaded on Size
uwsgiconf-0.8.0-py2.py3-none-any.whl (md5) Python Wheel 2.7 2017-08-11 108KB
uwsgiconf-0.8.0.tar.gz (md5) Source 2017-08-11 94KB