G
G
Grigory KOVALENKO2018-10-16 22:36:56
Python
Grigory KOVALENKO, 2018-10-16 22:36:56

How to do it in python?

Hello. I'm not very familiar with the possibilities of Python.
I want to write a script in python that will listen to incoming http requests in json format on a specific port, process them and return json back as a response.
Having received a json request, I will parse it, connect to the PostgreSQL database, add a record, and return the success of the operation in json.
I'm not asking how to do it, my question is which libraries to use.
It will be a console application, constantly running and listening on the port.
I'd be grateful if you point me in the right direction

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sim3x, 2018-10-16
@otwebsafe

nginx + uWSGI:
  flask: raw_sql or sqlAlchemy
  or
  django

B
bbkmzzzz, 2018-10-16
@bbkmzzzz

If the requests are of the same type and not very complex - the TCP library. Provides raw sockets. We listen to the port, parse the data and further down the list. Well, or full-fledged http frameworks, and la django or flask
For json, the json library =)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question