Python Frameworks

How To Query Tables and Paginate Data in Flask-SQLAlchemy — step-by-step Python tutorial on Progressive Robot

How To Query Tables and Paginate Data in Flask-SQLAlchemy

In this tutorial, you’ll use Flask and Flask-SQLAlchemy to create an employee management system with a database that has a table for employees. You’ll use the Flask shell to query a table, and get table records based on a column value. You’ll retrieve records on certain conditions. You’ll order the results by a column value, and count and limit query results. Finally, you’ll use pagination to display a certain number of records per page in a web application.

Read more
How To Use an SQLite Database in a Flask Application — step-by-step Databases tutorial on Progressive Robot

How To Use an SQLite Database in a Flask Application

In web applications, you usually need a database, which is an organized collection of data. SQLite is a simple and fast open source SQL engine that can be used with Python to store and manipulate application data. SQLite works well with Python because the Python standard library provides the sqlite3 module, which you can use to interact with any SQLite database. In this tutorial, you’ll build a small web application that demonstrates how to use SQLite with Flask.

Read more
How To Use Templates in a Flask Application — step-by-step Python tutorial on Progressive Robot

How To Use Templates in a Flask Application

Jinja is the templating language that Flask uses to render HTML templates. Using templates allows you to separate the business logic of your application from the presentation logic. These templates provide many features that are not available in standard HTML, such as variables, if statements, for loops, filters, and template inheritance. This helps with maintenance of HTML pages, and prevents Cross-Site Scripting attacks.

Read more
CHAT