[Solved]-Consume kafka messages from django app

3👍

yes, you can use your django code/repository and build separate app/program to deal with kafka queue and database through django ORM

just add at begin of this program code like

sys.path.append(os.getcwd())
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "<your_app>.settings")
django.setup()

and then you can use your models in this program, like

from <your_app>.models.timeslots import TimeSlotReserve

also good idea is to add some multithreading to this separate app

Leave a comment