Skip to main content

14 docs tagged with "flask"

View all tags

Blueprints in Flask: Modularizing your application

Following our lesson on Session and Cookie Management in Flask, this article explores Blueprints in Flask: Modularizing your application. As your Flask application grows, it becomes necessary to organize it into smaller, reusable components. Blueprints are the perfect tool for this.

Building a Simple CRUD App with Flask and SQLAlchemy

Following our introduction to Working with Databases: Introduction to SQLAlchemy, this article will guide you through Building a Simple CRUD App with Flask and SQLAlchemy. CRUD stands for Create, Read, Update, and Delete, which are the four basic functions of persistent storage.

Forms in Flask: Using request.form

Following our exploration of Handling HTTP Methods Using request.form. This is key to building interactive web applications that collect and process user input.

Handling HTTP Methods: GET, POST

Following our exploration of Templates in Flask (Part 2) GET, POST. This concept is essential for creating interactive web applications that can receive and process user data.

Request and Response Objects in Flask

We now know how to route a URL to a specific view function. But web development is a two-way street. Our application needs to be able to receive data from the user and send back more than just a simple string of HTML.

Routing in Flask: Variable Rules and URL Building

We've successfully created a simple Flask application that can serve a response from a single URL. But a real website has many pages: an about page, a contact page, user profiles, and so on. The system that maps URLs to the Python functions that handle them is called routing.

Session and Cookie Management in Flask

Following our guide on Building a Simple CRUD App with Flask and SQLAlchemy, this article explains Session and Cookie Management in Flask. HTTP is a stateless protocol, meaning each request is independent. Sessions and cookies allow us to store information across multiple requests from the same user.

Templates in Flask (Part 1): Template Inheritance

We've learned how to use Flask's render_template() function to serve HTML files and pass variables to them. This is great, but as you build a website with multiple pages, you'll notice that a lot of your HTML is repetitive. The navigation bar, the footer, the `` section with all your CSS links—these are the same on every page.

Templates in Flask (Part 2): Control Structures and Filters

We've learned how to render templates and pass variables from our Flask application to our HTML. Now, let's unlock the true power of the Jinja2 templating engine by exploring two of its most important features: control structures and filters.

What is Flask? A Micro Web Framework

Now that we understand the basic concepts of how the web works, it's time to choose a tool to help us build web applications in Python. There are many choices, but one of the most popular, especially for beginners and for building smaller applications and APIs, is Flask.

Your First Flask App (Part 2): Templates and Jinja2

In the last article, we created our first Flask application, but our view function returned a simple string of HTML. This is not practical for building real websites. A real website has complex HTML, and we need a way to keep our Python logic separate from the presentation markup.

Your First Flask App: 'Hello, Web!' (Part 1)

With our environment set up, it's time to write our very first web application with Flask. The traditional starting point for any new programming endeavor is the "Hello, World!" application. We'll create a simple web server that, when accessed, returns that classic phrase to the user's browser.