How to communicate between C++ server app and django web app
c++, django, json, python
Solution
If your requirement is guaranteed to always have the `C++` application on the same machine as the `Django` web application, include the `C++` code by converting it into a shared library and wrapping python around it. Just like this Calling C/C++ from python?
JSON and other serializations make sense if you are going to do remote calls and the code needs to communicate across machines.
Problem
I have some framework doing specific task in C++ and a django-based web app. The idea is to launch this framework, receive some data from it, send some data or request and check it's status in some period. I'm looking for the best way of communication. Both apps run on the same server. I was wondering if a json server in C++ is a good idea. Django would send a request to this server, and server would parse it, and delegate a worker thread to complete the task. Almost all data that need to be send is string-like. Other data will be stored in database so there is no problem with that. Is JSON a good idea? Maybe you know some better mechanism for local communication between C++ and django?