flask

Supercharge your applications queries with caching

Supercharge your applications queries with caching

Have you ever wondered how some websites seem to load information almost instantly, even when dealing with massive amounts of data? The secret often lies in a technique called caching. In this post, we'll explore what caching is, why it's important, and how I implemented it to supercharge my application's leaderboard feature. What is Caching? A Library Analogy Imagine a vast library where a librarian must search through millions of books for each patron's request. Now, picture a small billboard at the entrance displaying answers to common questions. Instead of searching the entire library each time, the librarian can quickly…
Read More
Creating relationships using SQLAlchemy in Python

Creating relationships using SQLAlchemy in Python

SQLAlchemy can help with many tasks required in Python when trying to create SQL tables one of those tasks is creating relationships. Creating relationships with SQLAlchemy is made much easier than using just SQL. It streamlines the process with easier to follow syntax and less steps. SQLAlchemy is imported into Python and all of the short cut syntax can be used. from flask_sqlalchemy import SQLAlchemy Enter fullscreen mode Exit fullscreen mode To create a relationship you must start by creating a table. SQLAlchemy makes this easy as well by shorting the syntax to: class Owner(db.Model, SerializerMixin): __tablename__ = "owners" id…
Read More
No widgets found. Go to Widget page and add the widget in Offcanvas Sidebar Widget Area.