Skip to content

koksalkapucuoglu/django-mqtt-app

Repository files navigation

mqtt_app app

Tech Stack

Core Tech: Python

Backend Service: Django, Django Rest Framework, MQTT

Database: SQLite

Documentation: Swagger

Features

  • Integrate Mqtt publising and subscribing system
  • Device and Broker management
  • Supports pagination system

Run Locally

Clone the project

  git clone https://github.com/koksalkapucuoglu/django-mqtt-app.git

Go to the project directory

  cd django-mqtt-app

Create python env

  python -m venv env

Activate enviroment

  source env/Scripts/activate

or

  env\Scripts\activate

Install requirements

  pip install -r requirements.txt

Detect django model changes

  python manage.py makemigrations

Apply django model changes

  python manage.py migrate

Run django project

  python manage.py runserver

App Device List

App Broker List

Add New Record Mqtt Device

Run django project

  python manage.py runserver

Open new terminal and activate enviroment

  env/Scripts/activate

Navigate mqtt_server directory

  cd mqtt_server

Run subscribe2django script

  python subscribe2django.py

Open new terminal and activate enviroment

  env/Scripts/activate

Navigate mqtt_server directory

  cd mqtt_server

Run publish_payload2django script

  python publish_payload2django.py

App Publist Payload

Make API calls against the server

  1. Go to http://localhost:8000/api/swagger to see Swagger documentation for API endpoints.
  2. Run the APIs by clicking the "Try it now" button on the Swagger page.

App Swagger