Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
A route demonstrating async behavior with delay.
from flask import Flask, jsonify
import asyncio
app = Flask(__name__)
@app.route('/async')
async def async_route():
await asyncio.sleep(1)
return jsonify({ 'message': 'Async response' })
if __name__ == '__main__':
app.run(debug=True, port=5000)Flask is a lightweight, WSGI-based web framework for Python. It emphasizes simplicity, flexibility, and minimalism, allowing developers to build web applications and APIs quickly without imposing a specific project structure.
Origin & Creator
Flask was created by Armin Ronacher in 2010 as part of the Pocoo project, aiming to provide a simple and extensible Python web framework.
Industrial Note
Flask is preferred for projects requiring flexibility, lightweight architecture, or microservices without the overhead of larger frameworks like Django.