Files
openidea/generators/flask.toml
T
l0ng-ai 605d5f4985 feat(new-project): project generators for mainstream languages and frameworks (#2689)
File › New Project offers 38 generators grouped by language (Java, Spring Boot, Quarkus, Micronaut, Kotlin, Ktor, Scala, Python/Django/FastAPI/Flask, Node/Vite/Next.js/Nuxt/Angular/SvelteKit/Astro/NestJS/Express, Go, Rust, C/C++, Zig, .NET, PHP/Laravel/Symfony, Ruby/Rails, Dart/Flutter, Swift, Elixir/Phoenix, Haskell, static website, empty). Each is a declaration in generators/<id>.toml run by the new ide-scaffold crate: built-in templates, the framework's official CLI run non-interactively, or a project service zip (Spring Initializr, code.quarkus.io, Micronaut Launch) whose metadata becomes form fields. Projects are built in a staging directory and moved into place only on success. The dialog renders each form from its schema, flags missing toolchains with install hints and streams progress; created projects open trusted. New Project is also on the welcome screen and the title bar project menu.

Closes #709
2026-11-11 17:22:57 +08:00

56 lines
986 B
TOML

id = "flask"
name = "Flask"
group = "Python"
icon = "project-flask"
order = 3
description = "A Flask application, with its environment managed by uv."
[[requires]]
program = "uv"
hint = "Install uv: https://docs.astral.sh/uv/getting-started/installation/"
[[fields]]
id = "python"
label = "Python version:"
type = "text"
placeholder = "Latest installed"
hint = "A version such as 3.13; uv downloads it when missing."
[[steps]]
label = "Running uv init"
program = "uv"
args = [
"init", "--bare", "--name", "{{name|kebab}}", "--vcs", "none", "--no-workspace",
{ if-set = "python", args = ["--python", "{{python}}"] },
]
[[steps]]
label = "Adding Flask"
program = "uv"
args = ["add", "flask"]
[[files]]
path = "app.py"
content = '''
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello_world():
return "Hello, World!"
if __name__ == "__main__":
app.run(debug=True)
'''
[[files]]
path = ".gitignore"
content = '''
.venv/
__pycache__/
*.pyc
'''