sivulich / mqttasgi

MQTT ASGI Protocol Server
MIT License
34 stars 15 forks source link

problem with running app with mqttasgi #20

Closed kessero closed 1 year ago

kessero commented 1 year ago

Hi, Quick question. I've problem with running testing project. Mqttasgi starts and I'am getting messages from mqtt broker but my website is unavailable. I try with dafne and works ok (on dev server website works too) it looks like mqttasgi not runnig my app. What can be wrong? my asgi.py

import os
import django
from channels.routing import ProtocolTypeRouter
from testmqtt.consumer import MyMqttConsumer
from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'testmqtt.settings')
django.setup()

application = ProtocolTypeRouter({
        'http': get_asgi_application(),
        'mqtt': MyMqttConsumer.as_asgi(),
    })

in settings.py I changed only:

INSTALLED_APPS = [
    'mqttasgi',
    'main',
...
WSGI_APPLICATION = 'testmqtt.wsgi.application'
ASGI_APPLICATION = "testmqtt.asgi.application"
sivulich commented 1 year ago

Hi Kessero, can you share your class MyMqttConsumer and how you are running the mqttasgi server? Note: The following line is not required mqttasgi doesn't support a wsgi application. WSGI_APPLICATION = 'testmqtt.wsgi.application'

sivulich commented 1 year ago

Closing due to lack of activity