O
O
Oleg Gamega2015-07-10 18:26:51
Flask
Oleg Gamega, 2015-07-10 18:26:51

Want to route in python with spring flavor?

Hello.
I'm still looking for that very silver bullet)) I know that it does not exist, but this is not a reason not to look)
I'm not a web developer, web is more of a hobby + personal small projects. After a long search, I temporarily settled on python flask.
I like python ─ it's light, elegant, it doesn't have that aftertaste that php has. (I am not an opponent of php, I am not a supporter of flat humor about it and I am sure that it will live for a very long time, but I just don’t like it)
flask is quite convenient, minimalistic, there is no Django combine, but there is one thing that I don’t like :

@app.route('/data')
def data():
    user = request.args.get('user')
    token = request.headers.get('token')


maybe I just don’t know how to do it better, or I didn’t look well, but other than something like
@app.route('/todo/api/v1.0/tasks/<int:task_id>', methods=['GET'])

I didn’t find it, I don’t like accessing a global variable, I want something like

@RequestMapping(value = "/data")
public String serveRest(@RequestParam("user") String user, @RequestHeader("token") String token){


PS both examples are from the ceiling and are a little suspended in a vacuum, but I think you understand what I mean

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2015-07-10
@sim3x

flask.pocoo.org/docs/0.10/patterns/sqlalchemy

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question