Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions templates/flask/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SECRET_KEY=your-secret-key
# test comment 4
10 changes: 10 additions & 0 deletions templates/flask/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Flask Project Template

A clean and modular Flask starter template using the application factory pattern and blueprints.

## Setup

```bash
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
11 changes: 11 additions & 0 deletions templates/flask/app/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from flask import Flask
from .config import Config

def create_app():
app = Flask(__name__)
app.config.from_object(Config)

from .routes import main
app.register_blueprint(main)

return app
4 changes: 4 additions & 0 deletions templates/flask/app/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import os

class Config:
SECRET_KEY = os.getenv("SECRET_KEY", "dev")
7 changes: 7 additions & 0 deletions templates/flask/app/routes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from flask import Blueprint, jsonify

main = Blueprint("main", __name__)

@main.route("/")
def home():
return jsonify({"message": "Flask template is running"})
2 changes: 2 additions & 0 deletions templates/flask/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
flask
python-dotenv
6 changes: 6 additions & 0 deletions templates/flask/run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from app import create_app

app = create_app()

if __name__ == "__main__":
app.run(debug=True)
Loading