Building a REST service

I have never used neither Python nor Django. However we are considering python for our next project and Django keeps coming up every time I look at Python.

We will be building a REST service - NOT a web site. I expect we would use OpenAPI, OAuth, and connect to some database.

Is django right for this type of project? Or is it overkill?
“flask” is the other keyword that keeps popping up in my searches.

Hi @nasht00

Welcome to the forum!

It’s definitely not overkill. In fact, it’s a perfect fit. Django REST Framework provides Open API compatible REST API’s with a lot of built-ins.

Check out awesome-django for a list of resources, including books covering making API’s, and if you’re interested in seeing more Django vs Flask info, see my post comparing them through the lens of a single file application.

Thanks,

Adam

I’ll second Adam’s answer.

We (the team I work on) build small web sites/web services. (The majority of the sites I build have 2 - 4 users - one of them me.) We used to have a mix of technologies, including Flask and Bottle. But usually, during the life of any of those projects, we’d run into something that would make us say “that would have been a whole lot easier if we were using Django.” So about 3 years ago, we decided to standardize all our Python web development on Django, large or small. (I even have a couple sites deployed on a Raspberry Pi.)

So no, I can’t think of any case where I’ve considered Django to be overkill. There may be features we don’t use, but it’s nice to know they’re there if needed. (The features you have and don’t use are ok. It’s when you need a feature and you don’t have it where you experience the pain.)

Ken

Django Rest Framework (a third party plugin for Django) is used a lot to create API’s in Python. It’s not the only one, but certainly the most commonly used.

You can use Flask as well. I’ve worked with both. Just understand that although both serve up responses to requests, their respective philosophies on how to do things are different. Fortunately, both have excellent documentation

-Jorge