Skip to main content

5 posts tagged with "flask"

flask tag description

View All Tags

Building a URL Redirector in Python for Dynamic QR Codes

· 4 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

If you print 1,000 posters with a QR code and the website URL changes next week, a "Static" QR code becomes a pile of wasted paper. The solution is a Dynamic QR code.

Instead of encoding your final destination (like myshop.com/promo-january), you encode a "Short URL" that you control (like myqr.link/offer). When a user scans it, your server looks up where offer should go today and redirects them instantly.

Measure the execution time of a function or endpoint in Flask

· 4 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

The best way to precisely measure the execution time of a function or endpoint in Flask is by using a decorator or middleware. This approach allows you to wrap your functions with timing logic without directly altering the original function's code, which keeps your application clean and maintainable.

Supabase Flask integration

· 5 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

Here's a simple example of how to integrate Supabase with a Flask application. This guide will cover how to set up the environment, connect to your Supabase project, and perform basic CRUD (Create, Read, Update, Delete) operations.

Best Practices for Using Pydantic with Flask for Request and Response Serialization

· 5 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

Pydantic is widely known for its powerful data validation and parsing capabilities using Python type hints. While it's most popular with FastAPI, it can be elegantly integrated with Flask to improve request validation, input parsing, and response formatting.

This article outlines best practices for combining Flask with Pydantic in a clean, maintainable way.