Add env variable for MQTT_CLIENT_ID
parent
ad2fc52ba1
commit
057e9e2b19
1
.env
1
.env
|
@ -2,3 +2,4 @@ DATABASE_URL="postgresql://localhost"
|
||||||
REDIS_URL=redis://localhost:6379
|
REDIS_URL=redis://localhost:6379
|
||||||
CELERY_TASK_SERIALIZER=json
|
CELERY_TASK_SERIALIZER=json
|
||||||
DEBUG=True
|
DEBUG=True
|
||||||
|
MQTT_CLIENT=local
|
||||||
|
|
|
@ -5,6 +5,6 @@ from .tasks.celery_configurator import make_celery
|
||||||
app = Flask(__name__, instance_relative_config=True)
|
app = Flask(__name__, instance_relative_config=True)
|
||||||
app.config.from_object('config')
|
app.config.from_object('config')
|
||||||
app.config.from_pyfile('config.py', silent=True)
|
app.config.from_pyfile('config.py', silent=True)
|
||||||
app.config['MQTT_CLIENT_ID'] = 'final-iot-backend-server-worker'
|
app.config['MQTT_CLIENT_ID'] = app.config['MQTT_CLIENT_ID'] + '-worker'
|
||||||
task_builder = make_celery(app)
|
task_builder = make_celery(app)
|
||||||
task_builder.autodiscover_tasks(['app.devices'])
|
task_builder.autodiscover_tasks(['app.devices'])
|
||||||
|
|
|
@ -29,7 +29,7 @@ CSRF_SESSION_KEY = "secret"
|
||||||
SECRET_KEY = "?['Z(Z\x83Y \x06T\x12\x96<\xff\x12\xe0\x1b\xd1J\xe0\xd9ld"
|
SECRET_KEY = "?['Z(Z\x83Y \x06T\x12\x96<\xff\x12\xe0\x1b\xd1J\xe0\xd9ld"
|
||||||
|
|
||||||
# MQTT configuration
|
# MQTT configuration
|
||||||
MQTT_CLIENT_ID = 'final-iot-backend-server-local2'
|
MQTT_CLIENT_ID = 'final-iot-backend-server-' + os.environ['MQTT_CLIENT']
|
||||||
MQTT_BROKER_URL = 'broker.hivemq.com'
|
MQTT_BROKER_URL = 'broker.hivemq.com'
|
||||||
MQTT_BROKER_PORT = 1883
|
MQTT_BROKER_PORT = 1883
|
||||||
MQTT_USERNAME = 'user'
|
MQTT_USERNAME = 'user'
|
||||||
|
|
Loading…
Reference in New Issue