Skip to content

zayycev22/fastapi_auth_tortoise_example

Repository files navigation

FastAPI-auth with Tortoise ORM example

This project provides a tutorial example of using the FasAPI-auth library using the Tortoise ORM. This repository demonstrates the main capabilities of the library.

What is this for

This repository represents a use-case for using the library. It shows the basic steps for interacting with the library, including user registration, authentication, serialization, and checking access permissions.

You can use this project as a guideline for integrating the library into your own project.

Installation

First of all clone the project

git clone https://github.com/zayycev22/fastapi_auth_tortoise_example.git

Install the library

pip install auth_fastapi[tortoise]

Create .env

touch .env

Generate SECRETE_KEY

fastapi_auth --generate-key

Set the SECRET_KEY environment variable in the .env file with the value you get in previous step

SECRET_KEY=1234

Docker

If you want to run with docker just run in the console

docker-compose up --build

The server will be available on http://127.0.0.1:8000/docs

Python

Be careful, library supports python >= 3.10

Run the installation dependencies command

pip install -r requirements.txt

Start the server

python main.py

The server will be available on http://127.0.0.1:8000/docs

About

FastAPI-auth use-case example with tortoise ORM

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published