# Initialize the Tornado app
def make_app():
    return Application([
        (r"/orders", OrderListHandler),    # Endpoint to list all orders
    ])

if __name__ == "__main__":
    app = make_app()
    app.listen(8888)
    print("Server is running on http://127.0.0.1:8888")
    IOLoop.current().start()
```

However, Tornado lacks some of the built-in tools and abstractions found in more modern frameworks like FastAPI, meaning you might spend more time building features available out of the box elsewhere.

## Making pragmatic choices

The Python API frameworks we've discussed each have distinct strengths and trade-offs, but choosing the right framework for your project might still be a daunting task.

To help you select a framework, we've created a flowchart that simplifies the decision-making process and a table that maps use cases to recommended frameworks. To use these resources, start with the flowchart to narrow your options based on your project's stage, requirements, and priorities. Then, consult the table to match your use case and requirements to recommended frameworks. 

![A flowchart for choosing a Python framework](/assets/blog/choosing-your-framework-python/framework-decision-diagram.png)


| **Use case**                | **Requirements**                             | **Recommended frameworks**          |
|-----------------------------|---------------------------------------------|--------------------------------------|
| **MVP with limited resources** | Quick setup, simplicity, flexibility         | Flask-RESTX, FastAPI                      |
| **Complex project**          | Scalability, structure, robust tools         | Django + DRF                        |
| **Secure enterprise application** | Strong security, maintainability, scalability | Django + DRF                        |
| **Fully async workload**     | High concurrency, non-blocking performance   | FastAPI, Tornado                    |
| **Real-time application**    | WebSocket support, low latency               | Tornado, Sanic                      |
| **Existing project**         | Gradual migration to async or scaling needs  | Django (with ASGI), FastAPI         |

Consider:

1. What does your project need most — stability or speed?
2. Are you starting fresh or scaling an existing application?
3. Does the framework support your required features without adding unnecessary risk?  
4. How well does the framework align with your team's expertise?

If your team has extensive experience with one framework, that might be your go-to for creating a REST API. If stability, reliability, and enterprise-grade features are your priorities, then [Django REST framework (DRF)](https://www.django-rest-framework.org/) probably makes sense. If your priorities are a modern developer experience, performance, or emerging async capabilities, then a cutting-edge framework like **FastAPI** is a great choice.