{"id":13501755,"url":"https://github.com/idlesign/uwsgiconf","last_synced_at":"2025-04-05T05:03:27.566Z","repository":{"id":51214555,"uuid":"92639189","full_name":"idlesign/uwsgiconf","owner":"idlesign","description":"Configure uWSGI from your Python code","archived":false,"fork":false,"pushed_at":"2025-03-26T15:14:56.000Z","size":853,"stargazers_count":77,"open_issues_count":4,"forks_count":2,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-29T04:04:09.454Z","etag":null,"topics":["configuration-management","configurator","django","python","uwsgi","wsgi"],"latest_commit_sha":null,"homepage":"https://github.com/idlesign/uwsgiconf","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/idlesign.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-28T04:10:27.000Z","updated_at":"2025-03-26T15:14:59.000Z","dependencies_parsed_at":"2024-01-16T10:37:30.726Z","dependency_job_id":"45a6fb97-d2b4-43cb-bfa8-906414eb5ffb","html_url":"https://github.com/idlesign/uwsgiconf","commit_stats":{"total_commits":511,"total_committers":2,"mean_commits":255.5,"dds":0.00195694716242667,"last_synced_commit":"b873bd542c77bbf6b5e72a277eff665f768d4e6c"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlesign%2Fuwsgiconf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlesign%2Fuwsgiconf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlesign%2Fuwsgiconf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlesign%2Fuwsgiconf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idlesign","download_url":"https://codeload.github.com/idlesign/uwsgiconf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289409,"owners_count":20914464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["configuration-management","configurator","django","python","uwsgi","wsgi"],"created_at":"2024-07-31T22:01:49.163Z","updated_at":"2025-04-05T05:03:27.530Z","avatar_url":"https://github.com/idlesign.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"uwsgiconf\n=========\nhttps://github.com/idlesign/uwsgiconf\n\n\n|release| |lic| |coverage|\n\n.. |release| image:: https://img.shields.io/pypi/v/uwsgiconf.svg\n    :target: https://pypi.python.org/pypi/uwsgiconf\n\n.. |lic| image:: https://img.shields.io/pypi/l/uwsgiconf.svg\n    :target: https://pypi.python.org/pypi/uwsgiconf\n\n.. |coverage| image:: https://img.shields.io/coveralls/idlesign/uwsgiconf/master.svg\n    :target: https://coveralls.io/r/idlesign/uwsgiconf\n\n\nDescription\n-----------\n\n*Configure uWSGI from your Python code*\n\nIf you think you know uWSGI you're probably wrong. It is always more than you think it is.\nThere are so many subsystems and options_ (800+) it is difficult to even try to wrap your mind around.\n\n.. _options: http://uwsgi-docs.readthedocs.io/en/latest/Options.html\n\n**uwsgiconf** allowing to define uWSGI configurations in Python tries to improve things the following ways:\n\n* It structures options for various subsystems using classes and methods;\n* It uses docstrings and sane naming to facilitate navigation;\n* It ships some useful presets to reduce boilerplate code;\n* It encourages configuration reuse;\n* It comes with CLI to facilitate configuration;\n* It features easy to use and documented **uwsgi stub** Python module;\n* It offers **runtime** package, similar to **uwsgidecorators**, but with more abstractions;\n* It features integration with Django Framework;\n* It is able to generate configuration files for Systemd, Upstart.\n* It can use ``pyuwsgi``.\n\n\n*Consider using IDE with autocompletion and docstings support to be more productive with uwsgiconf.*\n\nBy that time you already know that **uwsgiconf** is just another configuration method. Why_?\n\n.. _Why: http://uwsgi-docs.readthedocs.io/en/latest/FAQ.html#why-do-you-support-multiple-methods-of-configuration\n\n\nOverview\n--------\n\nStatic configuration\n~~~~~~~~~~~~~~~~~~~~\n\nLet's make ``uwsgicfg.py``. There we configure uWSGI using nice ``PythonSection`` preset to run our web app.\n\n.. code-block:: python\n\n    from uwsgiconf.config import configure_uwsgi\n    from uwsgiconf.presets.nice import PythonSection\n\n\n    def get_configurations():\n        \"\"\"This should return one or more Section or Configuration objects.\n        In such a way you can configure more than one uWSGI instance in the same place.\n\n        Here we'll define just one configuration section, which\n        will instruct uWSGI to serve WSGI application (from wsgi.py module)\n        on http://127.0.0.1:8000. We use .bootstrap shortcut method\n        to construct our configuration section object.\n\n        \"\"\"\n        return PythonSection.bootstrap('http://127.0.0.1:8000', wsgi_module='/home/idle/myapp/wsgi.py')\n\n\n    # Almost done. One more thing:\n    configure_uwsgi(get_configurations)\n\n\n\n1. Now if you want to generate ``myconf.ini`` file and use it for uWSGI manually you can do it with:\n\n    .. code-block:: bash\n\n        $ uwsgiconf compile \u003e myconf.ini\n        $ uwsgi myconf.ini\n\n2. Or use ``uwsgiconf`` to automatically spawn uWSGI processes for configurations defined in your module:\n\n    .. code-block:: bash\n\n        $ uwsgiconf run\n\n\n**Note:** ``uwsgiconf`` CLI requires ``click`` package available (can be installed with ``uwsgiconf``).\n\n\nRuntime configuration\n~~~~~~~~~~~~~~~~~~~~~\n\n**uwsgiconf** comes with ``runtime`` package which is similar to **uwsgidecorators** but\noffers different abstractions to provide useful shortcuts and defaults.\n\nThese abstractions will also use a stub ``uwsgi`` module when the real one is not available.\n\nA couple of examples:\n\n.. code-block:: python\n\n    from uwsgiconf.runtime.locking import lock\n    from uwsgiconf.runtime.scheduling import register_timer_rb\n\n    @register_timer_rb(10, repeat=2)\n    def repeat_twice():\n        \"\"\"This function will be called twice with 10 seconds interval\n        using red-black tree based timer.\n\n        \"\"\"\n        with lock():\n            # Code under this context manager will be locked.\n            do_something()\n\n\nAllows for runtime access to:\n\n* Alarms\n* Caches\n* Locks\n* Logging\n* Monitoring\n* Mules\n* RPC\n* Scheduling\n* Signals\n* Websockets\n* and more\n\n\nThird parties support\n~~~~~~~~~~~~~~~~~~~~~\n\n**Django**\n\nRun your Django-based project on uWSGI using manage command:\n\n.. code-block:: bash\n\n    $ ./manage.py uwsgi_run\n    $ ./manage.py uwsgi_reload --force\n\n\n* Other commands are available.\n* uWSGI summary and statistics are also available from Admin interface.\n* Django cache based on uWSGI cache.\n* and more\n\n\nSystem configs\n~~~~~~~~~~~~~~\n\nCompile system service config (e.g ``systemd``) to run your uWSGI-powered project:\n\n.. code-block:: bash\n\n    $ uwsgiconf sysinit systemd\n\n\n\nDocumentation\n-------------\n\nMore information can be found at http://uwsgiconf.readthedocs.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidlesign%2Fuwsgiconf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidlesign%2Fuwsgiconf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidlesign%2Fuwsgiconf/lists"}