Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

208
Vistas
How can i run Django channels on production?

I deployed a simple Django app to a VPS, here is my environment:

virtualenv
gunicorn
nginx
systemd

Everything works perfectly, i can see my template loading. I also added a small Django Channels feature, but that part doesn't work; so while i can use it on WSGI without any problem, if i try to reach a Consumer, i will get an error. So my question is: how can i run Channels too in production?

Here is what i currently did:

/etc/nginx/sites-available/myproject

server {
        listen 80;
        server_name 54.39.20.155;

        location = /favicon.ico { access_log off; log_not_found off; }
        location /static/ {
            root /WaitingRoomVenv/WaitingRoom/WaitingRoom/static;
        }

        location / {
            include proxy_params;
            proxy_pass http://unix:/WaitingRoomVenv/WaitingRoomEnv.sock;
        }
    }

/etc/systemd/system/gunicorn.service

[Unit]
Description=gunicorn daemon
After=network.target

[Service]
User=root
Group=www-data
WorkingDirectory=/WaitingRoomVenv/WaitingRoom
ExecStart=/WaitingRoomVenv/WaitingRoomEnv/bin/gunicorn --access-logfile - --workers 3 --bind unix:/WaitingRoomVenv/WaitingRoomEnv.sock WR.wsgi:application

[Install]
WantedBy=multi-user.target

To start gunicorn: sudo systemctl start gunicorn To start nginx: sudo systemctl restart nginx

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

To access channesl you need to run through a ASGI server like daphne (that ships with channels) instead of WSGI geunicorn you are using, see:

https://channels.readthedocs.io/en/latest/deploying.html

to start the server daphne -p 8001 myproject.asgi:application then in your nginx you need to proxy pass to port 8001

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda