Skip to content

Instantly share code, notes, and snippets.

@cdphantom
cdphantom / django_fastapi.md
Created April 21, 2026 16:37 — forked from mredvard/django_fastapi.md
Example of django fastapi integration by llama3 8B

Here is an example of how you can integrate Django and FastAPI:

Let's say we have a project that requires both backend functionality (using Django) and API endpoints (using FastAPI). We'll create a simple blog app with user authentication using Django, and add some API endpoints to retrieve and manipulate blog posts using FastAPI.

Step 1: Create a new Django project

Create a new Django project using django-admin startproject myblog. This will create a basic directory structure for our project.

Step 2: Create the Django app