diff options
author | Gourav <gouravkandoria1500@gmail.com> | 2024-06-26 11:14:50 +0530 |
---|---|---|
committer | Andrew Clayton <a.clayton@nginx.com> | 2024-07-02 19:13:14 +0100 |
commit | a9aa9e76db2766a681350c09947df848898531f6 (patch) | |
tree | b95692f62e8bce738656740e6fb8fea20fe03b76 /src/nxt_process_title.c | |
parent | d62a5e2c3749a927e1f5283c1ad2178d665cd399 (diff) | |
download | unit-a9aa9e76db2766a681350c09947df848898531f6.tar.gz unit-a9aa9e76db2766a681350c09947df848898531f6.tar.bz2 |
python: Support application factories
Adds support for the app factory pattern to the Python language module.
A factory is a callable that returns a WSGI or ASGI application object.
Unit does not support passing arguments to factories.
Setting the `factory` option to `true` instructs Unit to treat the
configured `callable` as a factory.
For example:
"my-app": {
"type": "python",
"path": "/srv/www/",
"module": "hello",
"callable": "create_app",
"factory": true
}
This is similar to other WSGI / ASGI servers. E.g.,
$ uvicorn --factory hello:create_app
$ gunicorn 'hello:create_app()'
The factory setting defaults to false.
Closes: https://github.com/nginx/unit/issues/1106
Link: <https://github.com/nginx/unit/pull/1336#issuecomment-2179381605>
[ Commit message - Dan / Minor code tweaks - Andrew ]
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to 'src/nxt_process_title.c')
0 files changed, 0 insertions, 0 deletions