mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-01-24 03:41:17 +00:00
Run ASGI server instead of WSGI
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
parent
1d81213773
commit
f3d611913e
@ -8,7 +8,20 @@ python manage.py loaddata initial
|
|||||||
nginx
|
nginx
|
||||||
|
|
||||||
if [ "$TFJM_STAGE" = "prod" ]; then
|
if [ "$TFJM_STAGE" = "prod" ]; then
|
||||||
gunicorn -b 0.0.0.0:8000 --workers=2 --threads=4 --worker-class=gthread tfjm.wsgi --access-logfile '-' --error-logfile '-';
|
gunicorn -b 0.0.0.0:8000 \
|
||||||
|
--workers=2 \
|
||||||
|
--threads=4 \
|
||||||
|
--worker-class=uvicorn.workers.UvicornWorker \
|
||||||
|
tfjm.asgi \
|
||||||
|
--access-logfile '-' \
|
||||||
|
--error-logfile '-'
|
||||||
else
|
else
|
||||||
python manage.py runserver 0.0.0.0:8000;
|
gunicorn -b 0.0.0.0:8000 \
|
||||||
|
--workers=2 \
|
||||||
|
--threads=4 \
|
||||||
|
--worker-class=uvicorn.workers.UvicornWorker \
|
||||||
|
tfjm.asgi \
|
||||||
|
--access-logfile '-' \
|
||||||
|
--error-logfile '-' \
|
||||||
|
--reload
|
||||||
fi
|
fi
|
||||||
|
@ -20,4 +20,5 @@ ipython~=8.5.0
|
|||||||
python-magic~=0.4.26
|
python-magic~=0.4.26
|
||||||
requests~=2.28.1
|
requests~=2.28.1
|
||||||
sympasoap~=1.1
|
sympasoap~=1.1
|
||||||
|
uvicorn~=0.17
|
||||||
whoosh~=2.7
|
whoosh~=2.7
|
@ -21,6 +21,7 @@ from django.contrib import admin
|
|||||||
from django.urls import include, path
|
from django.urls import include, path
|
||||||
from django.views.defaults import bad_request, page_not_found, permission_denied, server_error
|
from django.views.defaults import bad_request, page_not_found, permission_denied, server_error
|
||||||
from django.views.generic import TemplateView
|
from django.views.generic import TemplateView
|
||||||
|
|
||||||
from participation.views import MotivationLetterView
|
from participation.views import MotivationLetterView
|
||||||
from registration.views import HealthSheetView, ParentalAuthorizationView, PhotoAuthorizationView, \
|
from registration.views import HealthSheetView, ParentalAuthorizationView, PhotoAuthorizationView, \
|
||||||
ScholarshipView, SolutionView, SynthesisView, VaccineSheetView
|
ScholarshipView, SolutionView, SynthesisView, VaccineSheetView
|
||||||
@ -64,6 +65,11 @@ if 'cas_server' in settings.INSTALLED_APPS: # pragma: no cover
|
|||||||
path('cas/', include('cas_server.urls', namespace="cas_server")),
|
path('cas/', include('cas_server.urls', namespace="cas_server")),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if settings.DEBUG:
|
||||||
|
# Serve static files in DEBUG mode
|
||||||
|
import django.contrib.staticfiles.urls
|
||||||
|
urlpatterns += django.contrib.staticfiles.urls.urlpatterns
|
||||||
|
|
||||||
handler400 = bad_request
|
handler400 = bad_request
|
||||||
handler403 = permission_denied
|
handler403 = permission_denied
|
||||||
handler404 = page_not_found
|
handler404 = page_not_found
|
||||||
|
Loading…
x
Reference in New Issue
Block a user