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 CI Docs

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

Pre-commit

We use pre-commit to run Ruff and MyPy before each commit.

pip install pre-commit
pre-commit install
# Run on all files
pre-commit run --all-files

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.post1.tar.gz (52.9 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.post1-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fast_django_asgi-0.1.3.post1.tar.gz
  • Upload date:
  • Size: 52.9 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.post1.tar.gz
Algorithm Hash digest
SHA256 64b80ad9e85de55c7b94861771c7671a62f85a366c57cf4eef83d76fac7f9282
MD5 9e7f0b6f388caf1bd857e256ae6b4dba
BLAKE2b-256 f04b85ca57dde83446fc89f79f10de195f54fc79f74ea69e77ff86c56b92bcee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fast_django_asgi-0.1.3.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 ebd3380a3b3bffa78f9586e682f99b2b78150a77a681a9018977321cf02d93ea
MD5 84951769760bec3255274342d7ecce06
BLAKE2b-256 30be84d363cce6936b9991800e0addbb149f3a53bc44ab54b655080bbe40e262

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