Skip to content

Applications

Classes

Applications

Applications(*args, **kwargs)

OptionsGroup

Applications.


name

.name: str = ''

Name to represent the group.


plugin

.plugin: bool | str = False

Indication this option group belongs to a plugin.


mount

1
2
3
4
5
.mount(
    mountpoint: str,  # (1)!
    app: str,  # (2)!
    into_worker: bool = False,  # (3)!
)
  1. URL part, or variable value.

    1
    2
    3
    4
    .. note:: In case of URL part you may also want to set ``manage_script_name`` basic param to ``True``.
    
    .. warning:: In case of URL part a trailing slash may case problems in some cases
        (e.g. with Django based projects).
    
  2. App module/file.

  3. Load application under mountpoint in the specified worker or after workers spawn.

Load application under mountpoint.

Example: * .mount('', 'app0.py') -- Root URL part * .mount('/app1', 'app1.py') -- URL part * .mount('/pinax/here', '/var/www/pinax/deploy/pinax.wsgi') * .mount('the_app3', 'app3.py') -- Variable value: application alias (can be set by UWSGI_APPID) * .mount('example.com', 'app2.py') -- Variable value: Hostname (variable set in nginx)


set_basic_params

1
2
3
4
5
6
7
.set_basic_params(
    exit_if_none: bool | None = None,  # (1)!
    max_per_worker: int | None = None,  # (2)!
    single_interpreter: bool | None = None,  # (3)!
    no_default: bool | None = None,  # (4)!
    manage_script_name: bool | None = None,  # (5)!
)
  1. Exit if no app can be loaded.

  2. Set the maximum number of per-worker applications.

  3. Do not use multiple interpreters (where available). Some of the supported languages (such as Python) have the concept of "multiple interpreters". By default every app is loaded in a new python interpreter (that means a pretty-well isolated namespace for each app). If all you want of the app is to be loaded in the same python vm, use this option.

  4. Do not automatically fallback to default app. By default, the first loaded app is mounted as the "default one". That app will be served when no mountpoint matches.

  5. You can to instruct uWSGI to map specific apps in the so called "mountpoint" and rewrite SCRIPT_NAME and PATH_INFO automatically. See .mount(). The WSGI standard dictates that SCRIPT_NAME is the variable used to select a specific application.


switch_into_lazy_mode

1
2
3
.switch_into_lazy_mode(
    affect_master: bool | None = None,  # (1)!
)
  1. If True only workers will be reloaded by uWSGI's reload signals; the master will remain alive.

    Warning

    uWSGI configuration changes are not picked up on reload by the master.

Load apps in workers instead of master.

This option may have memory usage implications as Copy-on-Write semantics can not be used.

Note

Consider using touch_chain_reload option in workers basic params for lazy apps reloading.