diff --git a/{{cookiecutter.project_slug}}/Procfile b/{{cookiecutter.project_slug}}/Procfile index 2f2fbe92..6424e048 100644 --- a/{{cookiecutter.project_slug}}/Procfile +++ b/{{cookiecutter.project_slug}}/Procfile @@ -1,6 +1,6 @@ release: python manage.py migrate {%- if cookiecutter.use_async == "y" %} -web: gunicorn config.asgi:application -k uvicorn.workers.UvicornWorker +web: gunicorn config.asgi:application -k uvicorn_worker.UvicornWorker {%- else %} web: gunicorn config.wsgi:application {%- endif %} diff --git a/{{cookiecutter.project_slug}}/compose/production/django/start b/{{cookiecutter.project_slug}}/compose/production/django/start index 73f686bd..38fc29b5 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/start +++ b/{{cookiecutter.project_slug}}/compose/production/django/start @@ -28,7 +28,7 @@ if compress_enabled; then fi {%- endif %} {%- 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 %} exec /usr/local/bin/gunicorn config.wsgi --bind 0.0.0.0:5000 --chdir=/app {%- endif %} diff --git a/{{cookiecutter.project_slug}}/gulpfile.js b/{{cookiecutter.project_slug}}/gulpfile.js index df434c13..ee6e7028 100644 --- a/{{cookiecutter.project_slug}}/gulpfile.js +++ b/{{cookiecutter.project_slug}}/gulpfile.js @@ -106,7 +106,7 @@ function imgCompression() { function asyncRunServer() { const cmd = spawn( 'gunicorn', - ['config.asgi', '-k', 'uvicorn.workers.UvicornWorker', '--reload'], + ['config.asgi', '-k', 'uvicorn_worker.UvicornWorker', '--reload'], {stdio: 'inherit'}, ); cmd.on('close', function (code) { diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index e12c0a70..4e89b945 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -24,6 +24,7 @@ flower==2.0.1 # https://github.com/mher/flower {%- endif %} {%- if cookiecutter.use_async == 'y' %} uvicorn[standard]==0.30.1 # https://github.com/encode/uvicorn +uvicorn-worker==0.2.0 # https://github.com/Kludex/uvicorn-worker {%- endif %} # Django