All Projects → idlesign → uwsgiconf

idlesign / uwsgiconf

Licence: BSD-3-Clause license
Configure uWSGI from your Python code

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to uwsgiconf

wsgi lineprof
WSGI middleware for line-by-line profiling
Stars: ✭ 47 (-37.33%)
Mutual labels:  wsgi
envyable
The simplest yaml to ENV config loader.
Stars: ✭ 78 (+4%)
Mutual labels:  configuration-management
a2wsgi
Convert WSGI app to ASGI app or ASGI app to WSGI app.
Stars: ✭ 78 (+4%)
Mutual labels:  wsgi
secret config
Centralized Configuration and Secrets Management for Ruby and Rails applications.
Stars: ✭ 15 (-80%)
Mutual labels:  configuration-management
django-http-exceptions
HTTP exceptions for django
Stars: ✭ 29 (-61.33%)
Mutual labels:  wsgi
keras-rest-API
A scalable Flask API to interact with a pre-trained Keras model.
Stars: ✭ 14 (-81.33%)
Mutual labels:  uwsgi
libconfini
Yet another INI parser
Stars: ✭ 106 (+41.33%)
Mutual labels:  configuration-management
php-nacos
阿里巴巴nacos配置中心-PHP客户端
Stars: ✭ 167 (+122.67%)
Mutual labels:  configuration-management
COVID19-FeedbackApplication
A simple application is developed to get feedback from a user and analyzing the text to predict the sentiment.
Stars: ✭ 13 (-82.67%)
Mutual labels:  configuration-management
fret
Framework for Reproducible ExperimenTs
Stars: ✭ 20 (-73.33%)
Mutual labels:  configuration-management
verchew
System dependency version checker.
Stars: ✭ 24 (-68%)
Mutual labels:  configuration-management
bts-ce-lite
BTS-CE-Lite (Boda-Lite) is a cross platform vendor and technology agnostic telecommunication network management desktop application
Stars: ✭ 24 (-68%)
Mutual labels:  configuration-management
cqfd
cqfd helps running commands inside the Docker container configured for your project, keeping the user and working directory the same inside the container
Stars: ✭ 48 (-36%)
Mutual labels:  configuration-management
node-mock-factory
🐋 node-mock-factory
Stars: ✭ 26 (-65.33%)
Mutual labels:  configuration-management
redconf
sync config from redis or others storage while the config values changed
Stars: ✭ 12 (-84%)
Mutual labels:  configuration-management
challenges-chef
📖 Challenges Your Chef Skills By Solving Real Questions.
Stars: ✭ 27 (-64%)
Mutual labels:  configuration-management
onix
A reactive configuration manager designed to support Infrastructure as a Code provisioning, and bi-directional configuration management providing a single source of truth across multi-cloud environments.
Stars: ✭ 89 (+18.67%)
Mutual labels:  configuration-management
up
UP - Ultimate Provisioner CLI
Stars: ✭ 43 (-42.67%)
Mutual labels:  configuration-management
js-sdk
JavaScript frontend SDK for ConfigCat. ConfigCat is a hosted feature flag service: https://configcat.com. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.
Stars: ✭ 21 (-72%)
Mutual labels:  configuration-management
superconfig
Access environment variables. Also includes presence validation, type coercion and default values.
Stars: ✭ 33 (-56%)
Mutual labels:  configuration-management

uwsgiconf

https://github.com/idlesign/uwsgiconf

release lic coverage

Description

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;
  • It offers runtime package, similar to uwsgidecorators, but with more abstractions;
  • It features integration with Django Framework;
  • It is able to generate configuration files for Systemd, Upstart.
  • It can use pyuwsgi.

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?

Overview

Static configuration

Let's make uwsgicfg.py. There we configure uWSGI using nice PythonSection preset to run our web app.

from uwsgiconf.config import configure_uwsgi
from uwsgiconf.presets.nice import PythonSection


def get_configurations():
    """This should return one or more Section or Configuration objects.
    In such a way you can configure more than one uWSGI instance in the same place.

    Here we'll define just one configuration section, which
    will instruct uWSGI to serve WSGI application (from wsgi.py module)
    on http://127.0.0.1:8000. We use .bootstrap shortcut method
    to construct our configuration section object.

    """
    return PythonSection.bootstrap('http://127.0.0.1:8000', wsgi_module='/home/idle/myapp/wsgi.py')


# Almost done. One more thing:
configure_uwsgi(get_configurations)
  1. Now if you want to generate myconf.ini file and use it for uWSGI manually you can do it with:

    $ uwsgiconf compile > myconf.ini
    $ uwsgi myconf.ini
  2. Or use uwsgiconf to automatically spawn uWSGI processes for configurations defined in your module:

    $ uwsgiconf run

Note: uwsgiconf CLI requires click package available (can be installed with uwsgiconf).

Runtime configuration

uwsgiconf comes with runtime package which is similar to uwsgidecorators but offers different abstractions to provide useful shortcuts and defaults.

These abstractions will also use a stub uwsgi module when the real one is not available.

A couple of examples:

from uwsgiconf.runtime.locking import lock
from uwsgiconf.runtime.scheduling import register_timer_rb

@register_timer_rb(10, repeat=2)
def repeat_twice():
    """This function will be called twice with 10 seconds interval
    using red-black tree based timer.

    """
    with lock():
        # Code under this context manager will be locked.
        do_something()

Allows for runtime access to:

  • Alarms
  • Caches
  • Locks
  • Logging
  • Monitoring
  • Mules
  • RPC
  • Scheduling
  • Signals
  • Websockets
  • and more

Third parties support

Django

Run your Django-based project on uWSGI using manage command:

$ ./manage.py uwsgi_run
$ ./manage.py uwsgi_reload --force
  • Other commands are available.
  • uWSGI summary and statistics are also available from Admin interface.

System configs

Compile system service config (e.g systemd) to run your uWSGI-powered project:

$ uwsgiconf sysinit systemd

Documentation

More information can be found at http://uwsgiconf.readthedocs.org/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].