0
I have a Client-Server application in Flask, running the two files on the same machine the connection works perfectly, but when I try to run the client on a different machine, the connection is not established. I put the server machine IP in the client file but I’m not successful. Does anyone have any idea what to do?
Server:
from flask import Flask, request
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
todos = {}
valores = {}
contador = 0
class TodoSimple(Resource):
    def get(self, todo_id):
        #return {todo_id: todos[todo_id]}
        return valores[todo_id]
    def put(self, todo_id):
        global contador, valores
        contador+=1
        #print(contador)
        todos[todo_id] = request.form['data']
        if contador==4:
            contador = 0
            valores['CPF'] = todos['CPF']
            valores['Latitude'] = todos['Latitude']
            valores['Longitude'] = todos['Longitude']
            valores['Velocidade'] = todos['Velocidade']
        return {todo_id: todos[todo_id]}
api.add_resource(TodoSimple, '/<string:todo_id>')
if __name__ == '__main__':
    app.run(debug=False)
Client:
from requests import put
put('http://localhost:5000/CPF', data={'data': '12345678910'}).json()
put('http://localhost:5000/Latitude', data={'data': '-3.10'}).json()
put('http://localhost:5000/Longitude', data={'data': '-20.4000'}).json()
put('http://localhost:5000/Velocidade', data={'data': '60.5'}).json()