flask-quickstart
August 2, 2024 ยท View on GitHub
https://flask.palletsprojects.com/en/3.0.x/quickstart/
Preparing environment
Create Python venv.
python -m venv .venv
Then activate.
. .venv/bin/activate
Upgrade pip and install dependencies.
pip install --upgrade pip setuptools
pip install poetry
poetry install --sync
Preview server
poe start
Open http://127.0.0.1:5000 in your browser.
poe debug start the app in debug mode.
For developers
Install volta (if not exists)
curl https://get.volta.sh | bash
Install npm packages
npm ci
Testing python script
poe test
E2E tests
Execute tests
npm run test
Roadmap
Quickstart
- A Minimal Application
- Debug Mode
- HTML Escaping
- Routing
- Variable Rules
- Unique URLs / Redirection Behavior
- URL Building
- HTTP Methods
- Static Files
- Rendering Templates
- Accessing Request Data
- Context Locals
- The Request Object
- File Uploads
- Cookies
- Redirects and Errors
- About Responses
- APIs with JSON
- Sessions
- Message Flashing
- Logging
- Hooking in WSGI Middleware
- Using Flask Extensions
- Deploying to a Web Server
Tutorial
- Project Layout
- Application Setup
- Define and Access the Database
- Blueprints and Views
- Templates
- Static Files
- Blog Blueprint
- Make the Project Installable
- Test Coverage
- Deploy to Production
Other
- pytest
- e2e test via Playwright
- pre-commit
- linter/formatter
- security check: *.py