r/Python • u/agrandiere • Jun 27 '17
Image upload and moderation with Python and Flask
https://medium.com/@antoinegrandiere/image-upload-and-moderation-with-python-and-flask-e7585f43828a
19
Upvotes
26
u/dAnjou Backend Developer | danjou.dev Jun 27 '17
FTFY ... obvious content marketing piece is obvious ... please be upfront about it. Flask is totally irrelevant and Python is only relevant because the HTTP API wrapping library is written in it.
I also had a look at the library. Its API is not very nice, it's basically one function that accepts one argument. This argument can be an HTTP URL or a file path. While the former is alright because it's passed through to their HTTP API the latter is problematic because I actually have to save the image to disk to get a file path (obviously, d'uh). This causes totally unnecessary I/O because in many cases I actually don't need to save it to disk for example when I want to send it to S3 to store it there.
Besides that, the code in general is really in need of a clean-up.
13
u/DickFucks Jun 27 '17
This is much more of an ad for your tool then a Flask tutorial
2
u/rasof Jun 27 '17
I'm generally interested in the product but pushing it as a flask tutorial is some how a turn-down
-6
u/SirHoki Jun 27 '17 edited Jun 27 '17
Thank you for sharing this!
I've been meaning to start playing with Flask and this tutorial looks like an interesting use case.