P
P
Philip Bondarev2018-03-19 17:03:25
Python
Philip Bondarev, 2018-03-19 17:03:25

Write your own server or use Django / Flask / Pyramid?

Good afternoon.
I'm starting to design a system a la PDM.
I decided to create it not as a wrapper over the database, but as a client-server application. The client will be written in QML.
Now the question arose in full growth - how to implement the server part?
Should I write my own server in Qt and receive and send data through QTcpSocket, or take one of the Web frameworks and communicate with the server via https?
If you take a ready-made framework, then which one?
For the role described above, as I understand it, Flask is better suited, but maybe I'm wrong?
Has anyone faced similar issues?
Maybe stumbled upon articles on the web?
In general, with a clear conscience, I would write the server part myself, but the prospect of creating a Web interface may also loom on the horizon, but this is not certain ...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
VrencchBug, 2018-03-19
@VrencchBug

Should I write my own server in Qt and receive and send data through QTcpSocket, or take one of the Web frameworks and communicate with the server via https?
A robust TCP server algorithm is spaghetti. And on the client too. Without proper attention, you risk getting Therac-25. And with a clear conscience, catch a crash after a month of stable work, then again, and then again.
Why do you need to write your own server?
Do you find popular protocols such as HTTP and WebSocket (which can be used by no means only in the browser) suitable for you? What, it is direct totally on all application do not approach? Where there is specificity, they write a module there, and the rest is made standard, and the wheel is not reinvented.

A
asd111, 2018-06-27
@asd111

If your application needs to update data in real time, then take any framework with web sockets for the server - this is essentially a ready-made asynchronous tcp server in your favorite language. It's easy to chat on websockets - almost every framework and language has a websocket chat example.
And if you don’t need a permanent connection to the server, then take django because django has a lot of ready-made ones, which means less work, and Django also has an admin panel out of the box.
You can combine these approaches and do one part on websockets and the other on https.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question