Duplicate MQTT Listener Responses in Django Application: Initialization Issue #110976
Unanswered
oyekamal
asked this question in
Codespaces
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Select Topic Area
Bug
Body
I have a Django application that also runs an MQTT server. I'm encountering an issue where the MQTT listener starts twice when I run the Django application. As a result, when I communicate with MQTT, it sends two responses back from Django. The MQTT server is initiated in the init.py file of my Django project.
my code in init.py file
import sys
if 'runserver' in sys.argv and 'manage.py' in sys.argv:
print("Starting.. MQtt server")
from . import mqtt_functions
mqtt_functions.client.loop_start()
Beta Was this translation helpful? Give feedback.
All reactions