Django dpahne prod

25 views
Skip to first unread message

Paul Haguet

unread,
Jun 5, 2023, 1:36:35 PM6/5/23
to Django users
Hello everyone, I'am looking to deploy Django ASGI project in production.

This is the actual setup. Because Daphne is installed into the project python manage.py runserver use the asgi.py file instead of wsgi.

Si with this config the project run with asgi on port 8000 and wsgi on port 5000.

Is there any big difference using

daphne -b 0.0.0.0 -p 8000 main.asgi:application

Instead of:
python manage.py runserver

[uwsgi]

uid             = www-data
gid             = www-data
socket          = 0.0.0.0:5000

for-readline    = /srv/settings.env
        env     = %(_)
endfor          =

plugin          = python3
chdir           = /var/www/application
module          = main.wsgi:application

virtualenv      = /srv/env
daemonize       = /var/log/uwsgi/uwsgi_worker.log

attach-daemon = sh -c "cd /var/www/application/ ; source /srv/env/bin/activate && python manage.py runserver 0.0.0.0:8000"
attach-daemon = sh -c "cd /var/www/application/ ; source /srv/env/bin/activate && python manage.py qcluster"

Reply all
Reply to author
Forward
0 new messages