Tutorials

Generating Secure Dynamic Templates with Jinja2
Generating Secure Dynamic Templates with Jinja2
Generating HTML from within Python is not fun, and actually pretty cumbersome because you have to do the HTML escaping with escape on your own to keep the application secure. Because of that Flask configures the Jinja2 template engine for you automatically. Templates can be used to generate any type of text file. For web applications, you’ll primarily be generating HTML pages, but you can also generate markdown, plain text for emails, and anything else.
Flask
Working With the Shell
Working With the Shell
The Python Flask tutorial 'Working with the Shell' provides guidance on using the interactive shell in Flask to execute Python commands in real-time. This tutorial explains how to create a request context, fire before/after request functions, and improve the shell experience.
Flask
Develop Flask App with Development Server
Develop Flask App with Development Server
In this tutorial, you will learn how to use the development server in Flask to run your Flask application during local development. The development server provides an interactive debugger and automatically reloads the code when changes are made. This tutorial will guide you through the steps to run the development server and handle common issues that may arise.
Flask
Deploy Flask Application
Deploy Flask Application
In this lab, we will learn how to deploy a Flask application to a server. We will create a distribution file for our application and install it on the server. The lab assumes you have a basic understanding of Flask, Python's virtual environments, and the command line.
Flask
Flask Unit Testing with Pytest and Coverage
Flask Unit Testing with Pytest and Coverage
In this lab, we will learn how to write unit tests for a Flask application. We will use pytest and coverage to test and measure our code. By the end of this lab, you will understand how to ensure your application works as expected and identify areas that need improvement.
Flask
Make Project Installable
Make Project Installable
In this lab, we will learn how to make a Python Flask project installable. This will make the project deployable and manageable using standard Python tools. This process is beneficial as it allows the project to be installed in different environments, manage dependencies, and isolate test environments.
Flask
Flask Blog Application
Flask Blog Application
In this lab, we'll walk through creating a blog application using Flask, a popular web framework in Python. This application will list all blog posts, allow logged-in users to create posts, and let authors edit or delete their own posts.
Flask
Styling Flask Application
Styling Flask Application
In this lab, we will learn how to add CSS to our Flask application to make it visually appealing. We will use static files, specifically a CSS file, to style our application. Static files are files that don't change, such as CSS files, JavaScript files, and images.
Flask
Flask Template Creation
Flask Template Creation
In this lab, we will learn how to create and use templates in Flask. Templates are a crucial part of web applications. They allow us to generate dynamic HTML pages that can display different data each time they are loaded. We'll be using the Jinja2 template engine that comes bundled with Flask.
Flask
Modular Flask Application with Authentication
Modular Flask Application with Authentication
In this lab, we will walk through how to create and use Flask blueprints to structure your application using views. Flask blueprints allow you to group related views, code, and resources together making your application modular and scalable. We will create a simple application which will include user authentication and blog posts functionality.
Flask
Python Flask SQLite Database Setup
Python Flask SQLite Database Setup
In this lab, we will learn how to define and access a SQLite database using the Python Flask framework. We will set up a SQLite database, establish a connection with it, create tables, and initialize the database.
Flask
Using Async and Await in Flask
Using Async and Await in Flask
This lab will guide you through the process of using async and await in Flask, a popular Python web framework. You will learn how to define asynchronous views and handlers, understand the performance implications of using async code, and explore background tasks in Flask.
Flask
Testing Flask Applications
Testing Flask Applications
In this lab, you will learn how to test Flask applications using the pytest framework. Testing is an important part of the software development process, as it helps to ensure the correctness and reliability of your application. Flask provides utilities for testing, making it easy to write tests for different parts of your application.
Flask
Secure Flask Web Application Development
Secure Flask Web Application Development
In this lab, we will explore important security considerations when developing web applications using Flask. We will cover topics such as Cross-Site Scripting (XSS), Cross-Site Request Forgery (CSRF), JSON security, security headers, and secure cookie options. By following these steps, you will learn how to enhance the security of your Flask applications.
Flask
Flask Jinja2 Templates
Flask Jinja2 Templates
In this lab, you will learn how to use Jinja2 templates in Flask. Jinja2 is a powerful template engine that allows you to generate dynamic HTML pages in your Flask application. Templates are a great way to separate the presentation logic from the business logic of your application.
Flask
Signals in Flask for Application Lifecycle
Signals in Flask for Application Lifecycle
In this lab, you will learn how to use signals in Flask, which are a lightweight way to notify subscribers of certain events during the lifecycle of the application and each request. Signals allow you to perform actions in response to specific events without directly affecting the application code. They are useful for testing, metrics, auditing, and more.
Flask
Flask Command Line Interface
Flask Command Line Interface
In this lab, you will learn how to use the Flask Command Line Interface (CLI) to manage your Flask application. The Flask CLI provides a set of commands that can help you run the development server, create custom commands, and more.
Flask
Flask Configuration Management
Flask Configuration Management
In this lab, you will learn how to handle configuration in a Flask application. Configuration allows you to change settings in your application based on different environments, such as toggling debug mode, setting secret keys, and other environment-specific variables.
Flask
  • Prev
  • 1
  • 2
  • Next