FastAPI + Django experiment

Overview

django-fastapi-example

This is an experiment to demonstrate one potential way of running FastAPI with Django. It won't be actively maintained. If you're interested in using FastAPI with Django, then you should just use this for inspiration.

Setup

pip install -r requirements.txt
cd django_fastapi/
./manage.py migrate
./manage.py createsuperuser 

Running

uvicorn project.asgi:app --debug

Routes

The Django app is available at /django (e.g. http://localhost:8000/django/admin/

The FastAPI app is is available at /api (e.g. http://localhost:8000/api/items/

You might also like...
fastapi-crud-sync

Developing and Testing an API with FastAPI and Pytest Syncronous Example Want to use this project? Build the images and run the containers: $ docker-c

JSON-RPC server based on fastapi
JSON-RPC server based on fastapi

Description JSON-RPC server based on fastapi: https://fastapi.tiangolo.com Motivation Autogenerated OpenAPI and Swagger (thanks to fastapi) for JSON-R

FastAPI Skeleton App to serve machine learning models production-ready.
FastAPI Skeleton App to serve machine learning models production-ready.

FastAPI Model Server Skeleton Serving machine learning models production-ready, fast, easy and secure powered by the great FastAPI by Sebastián Ramíre

row level security for FastAPI framework

Row Level Permissions for FastAPI While trying out the excellent FastApi framework there was one peace missing for me: an easy, declarative way to def

FastAPI framework plugins

Plugins for FastAPI framework, high performance, easy to learn, fast to code, ready for production fastapi-plugins FastAPI framework plugins Cache Mem

python fastapi example  connection to mysql
python fastapi example connection to mysql

Quickstart Then run the following commands to bootstrap your environment with poetry: git clone https://github.com/xiaozl/fastapi-realworld-example-ap

The template for building scalable web APIs based on FastAPI, Tortoise ORM and other.

FastAPI and Tortoise ORM. Powerful but simple template for web APIs w/ FastAPI (as web framework) and Tortoise-ORM (for working via database without h

Ready-to-use and customizable users management for FastAPI
Ready-to-use and customizable users management for FastAPI

FastAPI Users Ready-to-use and customizable users management for FastAPI Documentation: https://frankie567.github.io/fastapi-users/ Source Code: https

Reusable utilities for FastAPI

Reusable utilities for FastAPI Documentation: https://fastapi-utils.davidmontague.xyz Source Code: https://github.com/dmontagu/fastapi-utils FastAPI i

Comments
  • Connection drops

    Connection drops

    Hi

    have you tried your approach with mysql or postgres ? The issue I encountered is that fastapi/async does not provide good place to ensure that db connection is still active

    https://github.com/tiangolo/fastapi/issues/716

    opened by vitalik 3
  • [Question] Django large CSV download timeout, so FastAPI would alleviate it in this context?

    [Question] Django large CSV download timeout, so FastAPI would alleviate it in this context?

    Thanks we have timeout issue of large CSV download 500 MB file or so, would FASTAPI alleviate timeout since FASTAPI supports async and Django does not? Appreciate it

    opened by scheung38 0
  • Any experience running this, or something similar in production?

    Any experience running this, or something similar in production?

    https://github.com/jordaneremieff/django-fastapi-example/blob/main/django_fastapi/project/asgi.py#L28

    Tried using the supplied uvicorn WSGIMiddleware in production and it was a bad time, might have been how it was configured though. Knobs on the number of gunicorn workers, and WSGIMiddelware threads?

    I was thinking of something like this:

    • https://github.com/allen-munsch/benchmark-django-fastapi/blob/main/testdjango/fastapi_with_django_mounted_asgi.py
    opened by allen-munsch 1
Owner
Jordan Eremieff
Hello
Jordan Eremieff
Example app using FastAPI and JWT

FastAPI-Auth Example app using FastAPI and JWT virtualenv -p python3 venv source venv/bin/activate pip3 install -r requirements.txt mv config.yaml.exa

Sander 28 Oct 25, 2022
FastAPI Learning Example,对应中文视频学习教程:https://space.bilibili.com/396891097

视频教学地址 中文学习教程 1、本教程每一个案例都可以独立跑,前提是安装好依赖包。 2、本教程并未按照官方教程顺序,而是按照实际使用顺序编排。 Video Teaching Address FastAPI Learning Example 1.Each case in this tutorial c

null 381 Dec 11, 2022
🤪 FastAPI + Vue构建的Mall项目后台管理

Mall项目后台管理 前段时间学习Vue写了一个移动端项目 https://www.charmcode.cn/app/mall/home 然后教程到此就结束了, 我就总感觉少点什么,计划自己着手写一套后台管理。 相关项目 移动端Mall项目源码(Vue构建): https://github.com/

王小右 131 Jan 1, 2023
Backend, modern REST API for obtaining match and odds data crawled from multiple sites. Using FastAPI, MongoDB as database, Motor as async MongoDB client, Scrapy as crawler and Docker.

Introduction Apiestas is a project composed of a backend powered by the awesome framework FastAPI and a crawler powered by Scrapy. This project has fo

Fran Lozano 54 Dec 13, 2022
Backend Skeleton using FastAPI and Sqlalchemy ORM

Backend API Skeleton Based on @tiangolo's full stack postgres template, with some things added, some things removed, and some things changed. This is

David Montague 18 Oct 31, 2022
FastAPI on Google Cloud Run

cloudrun-fastapi Boilerplate for running FastAPI on Google Cloud Run with Google Cloud Build for deployment. For all documentation visit the docs fold

Anthony Corletti 139 Dec 27, 2022
Auth for use with FastAPI

FastAPI Auth Pluggable auth for use with FastAPI Supports OAuth2 Password Flow Uses JWT access and refresh tokens 100% mypy and test coverage Supports

David Montague 95 Jan 2, 2023
FastAPI Boilerplate

FastAPI Boilerplate Features SQlAlchemy session Custom user class Top-level dependency Dependencies for specific permissions Celery SQLAlchemy for asy

Hide 417 Jan 7, 2023
Minimal example utilizing fastapi and celery with RabbitMQ for task queue, Redis for celery backend and flower for monitoring the celery tasks.

FastAPI with Celery Minimal example utilizing FastAPI and Celery with RabbitMQ for task queue, Redis for Celery backend and flower for monitoring the

Grega Vrbančič 371 Jan 1, 2023
A simple docker-compose app for orchestrating a fastapi application, a celery queue with rabbitmq(broker) and redis(backend)

fastapi - celery - rabbitmq - redis -> Docker A simple docker-compose app for orchestrating a fastapi application, a celery queue with rabbitmq(broker

Kartheekasasanka Kaipa 83 Dec 19, 2022