This repository is created to show-case how data models, APIs and unit testing are developed in Django Ninja and FastAPI.
The scope of it is for learning purposes only and it is the base for the following Medium articles:
- Django and FastAPI: Introduction
- Django and FastAPI: One To One Relationships
- Django and FastAPI: One To Many Relationships
- Django and FastAPI: Many To Many Relationships
The FastAPI codebase is also use for data analysis of Medium articles, using the text analysis features from PostgreSQL.
If you are a medium writer, export your articles and place them under medium_data
.
Run:
make fastapi_app
- in another shell,
load_medium_data
Articles:
- Text Analytics With PostgreSQL And SQLAlchemy - Part1
- 3 Ways To Filter On Order In PostgreSQL
- Term Frequency With PostgreSQL
- 100 Medium Articles
Pre-requisites:
- docker
- docker-compose
Django docs: https://www.djangoproject.com/
Django Ninja docs: https://django-ninja.dev/
make django_app
, to run the app at http://0.0.0.0:3010make django_test
, to execute the tests
FastAPI docs: https://fastapi.tiangolo.com/
SQLAlchemy docs: https://docs.sqlalchemy.org/en/20/
Alembic: https://alembic.sqlalchemy.org/en/latest/
make fastapi_app
, to run the app at http://0.0.0.0:3011make fastapi_test
, to execute the tests
- Pydantic docs: https://docs.pydantic.dev/latest/
- run
make check
for formatting