Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

273
Views
Implementación de asgi y wsgi en Heroku

Estoy tratando de implementar Django Channels en Heroku usando asgi junto con mi implementación wsgi existente. ¿Puedo implementar asgi y wsgi en heroku con la siguiente configuración?

Mi perfil:

 web: gunicorn chatbot.wsgi --preload --log-file - daphne: daphne chat.asgi:channel_layer --port $PORT --bind 0.0.0.0 -v2 chatworker: python manage.py runworker --settings=chat.settings -v2

Mi archivo asgi.py:

 import os from channels.asgi import get_channel_layer os.environ.setdefault("DJANGO_SETTINGS_MODULE", "chat.settings") channel_layer = get_channel_layer()

Mi archivo wsgi.py:

 import os from django.core.wsgi import get_wsgi_application from whitenoise.django import DjangoWhiteNoise os.environ.setdefault("DJANGO_SETTINGS_MODULE", "chat.settings") application = get_wsgi_application() application = DjangoWhiteNoise(application)

Y mis capas de canal en settings.py:

 CHANNEL_LAYERS = { 'default': { "BACKEND": "asgi_redis.RedisChannelLayer", "CONFIG": { "hosts": [os.environ.get('REDIS_URL', 'redis://localhost:6379')] }, 'ROUTING': 'chat.routing.channel_routing', } }
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Resolví esto, en caso de que esto pueda ser relevante para alguien más. Usar solo asgi fue la mejor solución. Mi perfil termino siendo:

 web: daphne chat.asgi:channel_layer --port $PORT --bind 0.0.0.0 -v2 chatworker: python manage.py runworker --settings=chat.settings -v2

Como solución para entregar archivos estáticos, actualicé mi archivo routing.py para incluir un StaticFileConsumer.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!