Bootstrap
<FreeKB>
Home
About
Walkthroughs
Flask
Profile
Sign in
FreeKB Articles
Flask articles
Cookies
Getting Started with Cookies
Date and Time
Date and Time
Email
Send Email using Flask-Mail
Send Email using SendGrid
Files
Read a file in Python Flask
Flash
Getting Started with Flash Messages
Flask Login
Getting Started with Flask Login
Functions
Use Python function in Jinja Template
GET POST requests
Get keys and values from URL
Submitting a GET request to an API
Submitting a POST request to an API
Getting Started
Getting Started with Flask on Linux
Getting Started with Flask using VSCode on Windows
HTML
Include HTML
Render HTML using the safe filter
HTTP Headers
GET HTTP Headers using the request module
Install
Install meinheld gunicorn Flask on Docker
Install uWSGI Nginx Flask on Docker
JSON
Getting Started with JSON and dictionary
Limiter
Limit Requests using flask_limiter
Logging
Customizing Docker Logs
dictConfig logger
Mobile
Determine if Mobile Device using Flask-Mobility
Modules
Importing your own modules
mySQL / MariaDB
Select from mySQL or MariaDB using Flask-SQLAlchemy
Port
Run Flask on a specific port
Python virtual environment
Running Flask app in Python virtual environment
Redirect
Redirect a URL
Redirect to a Route using redirect and url_for
Redirect to an HTML page using render_template
Redis Cache
Getting Started with Redis Cache
Routes / Blueprints
Catch All Route
Creating endpoints using Routes
Passing values into a route
Resolve 308 Redirect
Session
Modify a session
Sessions
Getting Started with Sessions
Session Duration
SQLAlchemy
Append records to table using SQLAlchemy
Connect to MariaDB using Flask-SQLAlchemy create_all
Connect to MariaDB using SQLAlchemy create_engine
Connect to mySQL using SQLAlchemy create_engine
Connect to Postgres using SQLAlchemy create_all
Connect to Postgres using SQLAlchemy create_engine
Connect to SQLite using SQLAlchemy
Count records in a table using SQLAlchemy
Create database using SQLAlchemy
Create table using SQLAlchemy
Determine if a database exists using SQLAlchemy
Determine if a table exists using SQLAlchemy
Getting Started with SQLAlchemy
Loop through SQLAlchemy results
Query records in a table using SQLAlchemy
Return SQLAlchemy results ascending, descending or shuffled
Update records in a table using SQLAlchemy
SSL
Force HTTP to redirect to HTTPS
Static
Static Files
Troubleshooting
Resolve "400 Bad Request: The browser (or proxy) sent a request that this server could not understand"
Resolve "AttributeError: 'function' object has no attribute 'query'"
Resolve "AttributeError: object has no attribute 'is_active'"
Resolve "Blueprint object has no attribute query"
Resolve "The 'sha256' password method is deprecated and will be removed in Werkzeug 3.0. Migrate to the 'scrypt' method."
Resolve "The current Flask app is not registered with this 'SQLAlchemy' instance"
Resolve SQLAlchemy "instance is not bound to a session"
Resolve SQLAlchemy "Lost connection to server during query"
Uploading Files
Uploading files
Username Password
Create secure password using generate_password_hash
Verify password using check_password_hash