Best option to build a simple REST API? Django Rest API or Flask API? Something else?

bernard

BuSo Pro
Joined
Dec 31, 2016
Messages
2,599
Likes
2,302
Degree
6
Best option to build a simple REST API?
Django Rest API or Flask API?
Something else?
 
Best option to build a simple REST API?

If you know Python then Django or Flask would be fine. Some folks use Node.js. For me, I have been using Phoenix Framework (https://phoenixframework.org/) for both REST/Open Graph APIs and Web Apps and it has been nothing but smooth sailing. The bottom line is to use whatever language/framework you're comfortable with and enjoy using, unless you want to use this opportunity to add something new to your arsenal, which in that case a REST API would be a great starter project.
 
Best option to build a simple REST API?
Django Rest API or Flask API?
Something else?
Like @SmokeTree says, go with what you know.

If this is for the Google sheets thing, then performance and / or library support aren't particularly relevent, since it's not much more than a proxy.

If Pythons your thing, but you don't have a lot of experience with either mentioned framework then flask is probably easier for this type of project.

If I was doing this, I would probably chose nodejs with koa, because it's very simple, has good library support, and performs well for this type of workload.

For larger more complex things, I would probably go with php Laravel, even though it's way heavier, because I know it inside out, it comes with spare batteries and a backup generator, composer has a well tested library for just about everything else, and if it saves me a couple of days of dev time, I can afford to run it on a dedicated server for 6 months and still come out on top.

If performance and scale was absolutely critical, I would probably write it in go, since it's bloody fast, and single binary deployment is really nice. It's a simple language, but not particularly enjoyable to write, with a fair amount of boilerplate.
I would probably get to like it more if I used it more frequently, but I just don't need that type of performance in the software I write.
 
Like @SmokeTree says, go with what you know.

If this is for the Google sheets thing, then performance and / or library support aren't particularly relevent, since it's not much more than a proxy.

I'm just gonna write a script in PHP and let people self host it, since I think more people will be comfortable running their own script with logins and passes. So it will be a proxy as you say, just taking two parameters and being called from Google App Script. The only reason I need it in the first place is because I can't figure out how to get from a SOAP api with GAS. They deprecated their SOAP client and now you have to write the full request in xml and its basically impossible. So I'm just gonna write it in PHP and then explain to people they have to upload a php file to their own server and such.

Another question,
How possible would it be to pay someone on Fiverr to deploy a Django or Flask app, if I just write the models and the processing scripts (scraping and calculations), then have someone do the views as well?
Is this "standard fare" that can be outsourced (and maintained) easily, sort of like paying someone to install and update Wordpress?
I just find the routing, database, view part of Django and Flask to be a hassle.
Maybe I should just get into Drupal? Isn't that sort of a Wordpress except with no full customizability with regards to types?
 
If I was doing this, I would probably chose nodejs with koa, because it's very simple, has good library support, and performs well for this type of workload.
nodejs world moves too fast, std lib is horrible, you'll need to use npm packages like popping pills, node_modules bloat, poor security with npm packages needed for everything, no typing, poor deployment experience, horrible debugging experience. I find it hard to recommend nodejs to anyone nowadays.

How possible would it be to pay someone on Fiverr to deploy a Django or Flask app, if I just write the models and the processing scripts (scraping and calculations), then have someone do the views as well?
Is this "standard fare" that can be outsourced (and maintained) easily, sort of like paying someone to install and update Wordpress?
Expect low quality code. Writing code is a skill, an art-- if you will. It takes a lot of experience to write good maintainable code that is well tested. Fiverr is not where you find people that can do this, they're gonna skip on a lot of things. And when you eventually have to go in and fix it for yourself, you'll be giving yourself a headache.

What you can do, is to get someone to style a framework for you (bootstrap, bulma), and then you just copy/paste in the template code in the views.

Go and look for freelance web designers, there are plenty out there that are self-respecting enough to not go onto fiverr. Many would be open to take jobs.
 
Last edited by a moderator:
If I was doing this, I would probably chose nodejs with koa, because it's very simple, has good library support, and performs well for this type of workload.

I don't know how the quote in the post above this got attributed to me but I definitely didn't say that. I've been happy with Phoenix for the past 3 years or so. Before Phoenix I used Ruby/Rails and created quite a few apps with it, a couple which still run solidly today. Never was a fan of node for anything more than writing libraries and using it for command line utilities that I'm able to execute from Elixir or pretty much any lang I use these days.
 
@FIREman I said if I was doing it I would use node, not that it's the best choice.
You might note my second choice was a bloated, slow framework based on one of the most maligned main stream languages - php.
And my third choice a butt ugly 90's throwback with added memory safety.

My point was, and is, go with what you know.
I would chose koa, because this is a web proxy, something that node is very suitable for, and something I have written in it multiple times, so I could write, test and deploy it in a single session.

Re fiverr I agree, budget outsourced development rarely turns out well. Any outsourced dev work is hard to manage of you don't know exactly what you want, and what good code looks like. Going cheap only increases the likelihood of failure
 
Back