Skip to main content

Django-like developer experience on ASGI powered by FastAPI, Tortoise ORM, Aerich, and FastAPI-Admin.

Project description

fast-django

Django-like Developer Experience on ASGI with FastAPI, Tortoise ORM, Aerich, and FastAPI-Admin

PyPI version Python Support License: MIT Code style: ruff Tests Documentation Status

DocumentationExamplesAPI ReferenceContributing

🚀 What is fast-django?

fast-django brings the familiar Django development experience to modern ASGI applications, combining the power of FastAPI with Django's developer-friendly patterns. It provides a clean abstraction layer that makes building high-performance web APIs as intuitive as Django.

✨ Key Features

  • 🏗️ Django-style CLI - Familiar manage.py commands for project management
  • 🗄️ Tortoise ORM - Django-like ORM with async support and migrations
  • 📊 Admin Interface - Auto-mounting admin UI with FastAPI-Admin
  • ⚙️ Pydantic Settings - Type-safe configuration with environment variables
  • 🛣️ Auto-routing - Automatic router discovery and inclusion
  • 🔧 Scaffolding - Generate projects and apps with startproject and startapp
  • 🚀 FastAPI-powered - Built on FastAPI for high performance and automatic API docs
  • 🔄 Aerich Migrations - Database migrations with automatic discovery
  • 🔔 Signals - Django-like request and ORM signals

🚀 Quick Start

Installation

pip install fast-django-asgi

Create Your First Project

# Create a new project
fast-django startproject myblog
cd myblog

# Create an app
fast-django startapp blog

# Set up the database
python manage.py makemigrations
python manage.py migrate

# Create a superuser
python manage.py createsuperuser --email admin@example.com

# Start the development server
python manage.py runserver

Visit http://127.0.0.1:8000 to see your app and http://127.0.0.1:8000/docs for automatic API documentation!

📖 Documentation

Local Documentation

pip install "fast-django-asgi[docs]"
mkdocs serve

🎯 Why fast-django?

Django Developers

If you love Django's developer experience but need the performance and modern features of FastAPI, fast-django is perfect for you. It provides:

  • Familiar CLI commands (manage.py runserver, makemigrations, etc.)
  • Django-style project structure and app organization
  • Similar ORM patterns and database operations
  • Admin interface that works like Django's admin

FastAPI Developers

If you're already using FastAPI but want a more structured approach to building applications, fast-django offers:

  • Project scaffolding and app organization
  • Database migrations and ORM integration
  • Admin interface out of the box
  • Settings management with environment variables

Modern Python Web Development

fast-django combines the best of both worlds:

  • Performance: Built on FastAPI and ASGI
  • Developer Experience: Django-like patterns and CLI
  • Type Safety: Full Pydantic integration
  • Modern Stack: Async/await, type hints, and modern Python features

🏗️ Architecture

fast-django provides a clean abstraction layer that combines:

  • FastAPI for the web framework and API layer
  • Tortoise ORM for database operations and models
  • Aerich for database migrations
  • FastAPI-Admin for the admin interface
  • Pydantic for settings and data validation

📦 What's Included

  • Core Application Factory: create_app() function for app initialization
  • Settings System: Environment-based configuration with FD_ prefix
  • ORM Integration: Re-exported Tortoise ORM components
  • CLI Tools: Complete command-line interface for project management
  • Admin System: Pluggable admin interface with model registration
  • Scaffolding: Templates for projects and apps
  • Middleware Support: Easy middleware configuration
  • Auto-discovery: Automatic app and model discovery

🛠️ Development

Prerequisites

  • Python 3.11+
  • pip or your preferred package manager

Installation

# Clone the repository
git clone https://github.com/AakarSharma/fast-django.git
cd fast-django

# Install in development mode
pip install -e ".[dev,test,docs]"

# Install pre-commit hooks
pre-commit install

Running Tests

# Run all tests
pytest

# Run with coverage
pytest --cov=src/fast_django --cov-report=html

# Run linting
ruff check . && ruff format --check .

# Run type checking
mypy src

Building Documentation

# Serve documentation locally
mkdocs serve

# Build documentation
mkdocs build

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Quick Contribution Steps

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests and linting (pytest && ruff check . && mypy src)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

📊 Project Status

  • Core Features: Complete and stable
  • Documentation: Comprehensive and up-to-date
  • Testing: High test coverage with CI/CD
  • Type Safety: Full type hints and mypy compliance
  • 🔄 Active Development: Regular updates and improvements

🆘 Support

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments


Made with ❤️ by the fast-django community

⭐ Star us on GitHub🐛 Report a bug💡 Request a feature

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fast_django_asgi-0.1.3.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fast_django_asgi-0.1.3-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file fast_django_asgi-0.1.3.tar.gz.

File metadata

  • Download URL: fast_django_asgi-0.1.3.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for fast_django_asgi-0.1.3.tar.gz
Algorithm Hash digest
SHA256 05b6674b35b9de3178e18ef212819479fc88d99ff06a96beabacc79cbadfe7a9
MD5 8b9a3389d58695b286f4ae1180d3f026
BLAKE2b-256 843c9e9403bfa029bef2d338880090c0b0870fa63f67947d42220c7254809029

See more details on using hashes here.

File details

Details for the file fast_django_asgi-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for fast_django_asgi-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1c26a482f8b0e09909b94b4ebf9a1cd6a56be3b74f366d42eecd4c977fa876ec
MD5 5e6e8f768c7903169359c64b1171ca52
BLAKE2b-256 64b0110ed6892d75eb3281aacac2bf1ad436dc8e001bcbf85531fb550439c28d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page