OneCompiler
Flask

Flask

Full Stack

Flask is a lightweight Python web framework that stays out of your way. This workspace has Flask installed and a working app on port 5000, so you can hit a running route in the built-in browser preview the moment it boots.

What's included

Flask, preconfigured

Flask is already installed from requirements.txt and app.py has a working route. Start the dev server and the preview opens on port 5000.

Real VS Code

The full cloud editor with an integrated terminal, extensions and a debug config in the .vscode folder, so F5 starts Flask in debug mode.

Live reload

Running with --debug turns on the reloader, so saving app.py restarts the server and your changes show up on the next request.

pip and Thunder Client

Add packages with pip and test routes without leaving the editor using the Thunder Client extension that ships with the workspace.

Tech stack

FlaskPythonpipWerkzeugJinjaVS Code

What is Flask?

Flask is a micro web framework for Python. It gives you routing, request handling and templating with Jinja, and leaves the bigger decisions like the database or auth up to you. That small footprint is why it's a popular choice for APIs, prototypes and services where you'd rather add only what you need.

This workspace ships a minimal Flask app so you're not starting from a blank file. Flask is already installed, there's a route returning a response, and the dev server is one command away. From there you add routes, templates and packages as the app grows.

What's inside this workspace

The app lives in app.py: a Flask instance with a single "/" route that returns a Hello, World response. requirements.txt pins Flask, and it's installed when the workspace boots. The .vscode folder includes a debug config, so F5 launches the app with breakpoints.

Everything else is yours to add. Create templates, register more routes, wire up a database, or pull in extensions with pip. The starter stays out of your way once you're past the first request.

Running your app

Open the terminal and run flask --app app.py run --host=0.0.0.0 --port=5000 --debug. The app starts on port 5000 and Studio opens it in the built-in browser preview. The --debug flag enables the reloader and an interactive traceback, so edits to app.py take effect without a manual restart.

What you can build with it

JSON APIs, server-rendered pages with Jinja templates, webhooks, small services and backends for a front end you host elsewhere. Anywhere you want a quick, unopinionated Python web server you can shape to fit the job.

Frequently asked questions

How do I run the Flask app?

Open the terminal and run flask --app app.py run --host=0.0.0.0 --port=5000 --debug, or press F5 to start it in debug mode. The app serves on port 5000 and Studio opens it in the built-in preview.

Where does the app run and how do I see it?

It runs on port 5000. Studio opens the app in a built-in browser preview automatically. If it doesn't, run the Studio Manager: SimpleBrowser Default URL command from the VS Code command palette.

How do I add more routes or packages?

Add routes in app.py with the @app.route decorator. For packages, install them with pip and add them to requirements.txt so the dependency is tracked.

Can I test my API without a browser?

Yes. Use curl from the terminal, for example curl http://localhost:5000, or open the bundled Thunder Client extension to send requests and inspect responses inside the editor.

Do code changes reload automatically?

When you run with the --debug flag, Flask's reloader restarts the server on save, so your changes apply on the next request without a manual restart.

Is it free?

Flask needs a paid plan. The free templates are marked as such in Studio, and you can upgrade any time from the pricing page to launch this workspace.

Related templates

Flask online Studio — cloud Python web workspace | OneCompiler