Fix async runserver command with Gulp/Webpack

This commit is contained in:
Bruno Alla 2022-03-26 12:27:31 +00:00
parent 121d4d347f
commit ccf6070d7f
2 changed files with 3 additions and 6 deletions

View File

@ -180,7 +180,7 @@ def handle_js_runner(choice, use_docker, use_async):
]
if not use_docker:
dev_django_cmd = (
"gunicorn config.asgi -k uvicorn.workers.UvicornWorker --reload"
"uvicorn config.asgi:application --reload"
if use_async
else "python manage.py runserver_plus"
)

View File

@ -104,12 +104,9 @@ function imgCompression() {
{%- if cookiecutter.use_async == 'y' -%}
// Run django server
function asyncRunServer() {
var cmd = spawn('gunicorn', [
'config.asgi', '-k', 'uvicorn.workers.UvicornWorker', '--reload'
], {stdio: 'inherit'}
)
var cmd = spawn('uvicorn', ['config.asgi:application', '--reload'], {stdio: 'inherit'})
cmd.on('close', function(code) {
console.log('gunicorn exited with code ' + code)
console.log('uvicorn exited with code ' + code)
})
}
{%- else %}