[Solved] ModuleNotFoundError: No module named ‘cryptography’

This error means you don’t have cryptography installed. Install it with pip install cryptography or by using the user interface in your IDE to install additional python packages. The cryptography package in Python has cryptographic “recipes” which make working with encryption easier and safer for developers. Easier because most of the hard work has already … Read more

[Solved] ModuleNotFoundError: No module named ‘boto3’

This error is caused by trying to import boto3 when it’s not installed. Fix this by simply running pip install boto3. Problem: boto3 is not installed If you don’t have the boto3 Python package installed, running the following code will give you an error: The error: Fix 1: install boto3 using pip Fix this by … Read more

FastAPI + SQLAlchemy Tutorial

The code for this article can be found on my GitHub: https://github.com/jmgraff/fastapi-sqlalchemy-sqlite-example FastAPI has made creating an API for your app incredibly simple. SQLAlchemy has also done the same for interacting with databases. Using both of them together makes it very simple to have your API store and retrieve data from a number of different … Read more

Full-Stack Example: Secure your FastAPI / React app with SuperTokens

The code for this article is a template repository on GitHub, and can be found here: https://github.com/jmgraff/fastapi-strawberry-urql-supertokens. Feel free to use it as a starting point for your own apps. SuperTokens is an open source authentication solution for the apps you build. You might be interested in something like SuperTokens if: If any of that … Read more

FastAPI: Task got Future attached to a different loop

This error is caused by creating an asyncio synchronization primitive such as an asyncio.Event before starting your asyncio loop, then using that primitive in the loop. To fix this, create the primitives you need to use from within the loop. This error was discovered when creating our real-time chat app example. In order to make … Read more