From 125ffec2431337fcd95bf74ea391e2097cd5a1e1 Mon Sep 17 00:00:00 2001 From: Andrew-Chen-Wang Date: Tue, 24 Mar 2020 20:51:43 -0400 Subject: [PATCH] Changed starting commands for running server * Performance is very low --- {{cookiecutter.project_slug}}/compose/local/django/start | 2 +- {{cookiecutter.project_slug}}/compose/production/django/start | 2 +- {{cookiecutter.project_slug}}/config/asgi.py | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_slug}}/compose/local/django/start b/{{cookiecutter.project_slug}}/compose/local/django/start index bc1293de..259e7cd1 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/start +++ b/{{cookiecutter.project_slug}}/compose/local/django/start @@ -7,7 +7,7 @@ set -o nounset python manage.py migrate {%- if cookiecutter.use_async %} -/usr/local/bin/uvicorn config.asgi --bind 0.0.0.0:5000 --chdir=/app +/usr/local/bin/gunicorn config.asgi --bind 0.0.0.0:8000 --chdir=/app -k uvicorn.workers.UvicornWorker -e DJANGO_SETTINGS_MODULE=config.settings.local --reload {%- else %} python manage.py runserver_plus 0.0.0.0:8000 {% endif %} diff --git a/{{cookiecutter.project_slug}}/compose/production/django/start b/{{cookiecutter.project_slug}}/compose/production/django/start index dd06949a..96c8987c 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 %} -/usr/local/bin/uvicorn config.asgi --bind 0.0.0.0:5000 --chdir=/app +/usr/local/bin/gunicorn config.asgi --workers 4 --bind 0.0.0.0:5000 --chdir=/app -k uvicorn.workers.UvicornWorker {% else %} /usr/local/bin/gunicorn config.wsgi --bind 0.0.0.0:5000 --chdir=/app {%- endif %} diff --git a/{{cookiecutter.project_slug}}/config/asgi.py b/{{cookiecutter.project_slug}}/config/asgi.py index 4cc878ca..3dd31f70 100644 --- a/{{cookiecutter.project_slug}}/config/asgi.py +++ b/{{cookiecutter.project_slug}}/config/asgi.py @@ -11,7 +11,6 @@ import sys from pathlib import Path from django.core.asgi import get_asgi_application - from .websocket import websocket_application # This allows easy placement of apps within the interior