mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-16 09:54:51 +03:00
Fix async runserver command with Gulp/Webpack
This commit is contained in:
parent
121d4d347f
commit
ccf6070d7f
|
@ -180,7 +180,7 @@ def handle_js_runner(choice, use_docker, use_async):
|
||||||
]
|
]
|
||||||
if not use_docker:
|
if not use_docker:
|
||||||
dev_django_cmd = (
|
dev_django_cmd = (
|
||||||
"gunicorn config.asgi -k uvicorn.workers.UvicornWorker --reload"
|
"uvicorn config.asgi:application --reload"
|
||||||
if use_async
|
if use_async
|
||||||
else "python manage.py runserver_plus"
|
else "python manage.py runserver_plus"
|
||||||
)
|
)
|
||||||
|
|
|
@ -104,12 +104,9 @@ function imgCompression() {
|
||||||
{%- if cookiecutter.use_async == 'y' -%}
|
{%- if cookiecutter.use_async == 'y' -%}
|
||||||
// Run django server
|
// Run django server
|
||||||
function asyncRunServer() {
|
function asyncRunServer() {
|
||||||
var cmd = spawn('gunicorn', [
|
var cmd = spawn('uvicorn', ['config.asgi:application', '--reload'], {stdio: 'inherit'})
|
||||||
'config.asgi', '-k', 'uvicorn.workers.UvicornWorker', '--reload'
|
|
||||||
], {stdio: 'inherit'}
|
|
||||||
)
|
|
||||||
cmd.on('close', function(code) {
|
cmd.on('close', function(code) {
|
||||||
console.log('gunicorn exited with code ' + code)
|
console.log('uvicorn exited with code ' + code)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user