Chapter 10: Injecting Rust into a Python Flask App
In Chapter 9, Structuring a Python Flask App for Rust, we set up a basic Python web application in Flask that could be deployed using Docker. In this chapter, we are going to fuse Rust into every aspect of that web application. This means polishing our skills of defining Rust packages that can be installed using pip
. With these packages, we are going to plug Rust code into our Flask and Celery containers. We are also going to directly interact with an existing database using Rust, without having to worry about migrations. This is because our Rust package is going to mirror the schema of the existing database. We will need a Rust nightly
version to compile our package, so we will also learn how to manage Rust nightly
when building our Flask image. We will also learn how to use Rust packages from private GitHub repositories.
In this chapter, we will cover the following topics:
- Fusing Rust into Flask and Celery
- Deploying...