mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-22 01:26:57 +03:00
Replace deprecated uvicorn.workers
with uvicorn-worker
(#5110)
* chore: Replace deprecated uvicorn.workers with uvicorn-worker * Add package and fix worker class name --------- Co-authored-by: Bruno Alla <alla.brunoo@gmail.com>
This commit is contained in:
parent
db38d8b00f
commit
b6656379af
|
@ -1,6 +1,6 @@
|
||||||
release: python manage.py migrate
|
release: python manage.py migrate
|
||||||
{%- if cookiecutter.use_async == "y" %}
|
{%- if cookiecutter.use_async == "y" %}
|
||||||
web: gunicorn config.asgi:application -k uvicorn.workers.UvicornWorker
|
web: gunicorn config.asgi:application -k uvicorn_worker.UvicornWorker
|
||||||
{%- else %}
|
{%- else %}
|
||||||
web: gunicorn config.wsgi:application
|
web: gunicorn config.wsgi:application
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
|
@ -28,7 +28,7 @@ if compress_enabled; then
|
||||||
fi
|
fi
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- if cookiecutter.use_async == 'y' %}
|
{%- if cookiecutter.use_async == 'y' %}
|
||||||
exec /usr/local/bin/gunicorn config.asgi --bind 0.0.0.0:5000 --chdir=/app -k uvicorn.workers.UvicornWorker
|
exec /usr/local/bin/gunicorn config.asgi --bind 0.0.0.0:5000 --chdir=/app -k uvicorn_worker.UvicornWorker
|
||||||
{%- else %}
|
{%- else %}
|
||||||
exec /usr/local/bin/gunicorn config.wsgi --bind 0.0.0.0:5000 --chdir=/app
|
exec /usr/local/bin/gunicorn config.wsgi --bind 0.0.0.0:5000 --chdir=/app
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
|
@ -106,7 +106,7 @@ function imgCompression() {
|
||||||
function asyncRunServer() {
|
function asyncRunServer() {
|
||||||
const cmd = spawn(
|
const cmd = spawn(
|
||||||
'gunicorn',
|
'gunicorn',
|
||||||
['config.asgi', '-k', 'uvicorn.workers.UvicornWorker', '--reload'],
|
['config.asgi', '-k', 'uvicorn_worker.UvicornWorker', '--reload'],
|
||||||
{stdio: 'inherit'},
|
{stdio: 'inherit'},
|
||||||
);
|
);
|
||||||
cmd.on('close', function (code) {
|
cmd.on('close', function (code) {
|
||||||
|
|
|
@ -24,6 +24,7 @@ flower==2.0.1 # https://github.com/mher/flower
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- if cookiecutter.use_async == 'y' %}
|
{%- if cookiecutter.use_async == 'y' %}
|
||||||
uvicorn[standard]==0.30.1 # https://github.com/encode/uvicorn
|
uvicorn[standard]==0.30.1 # https://github.com/encode/uvicorn
|
||||||
|
uvicorn-worker==0.2.0 # https://github.com/Kludex/uvicorn-worker
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
# Django
|
# Django
|
||||||
|
|
Loading…
Reference in New Issue
Block a user