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
🚀 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.pycommands 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
startprojectandstartapp - 🚀 FastAPI-powered - Built on FastAPI for high performance and automatic API docs
- 🔄 Aerich Migrations - Database migrations with automatic discovery
🚀 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
- Getting Started - Complete setup guide
- Core Concepts - Routing, ORM, Settings, and more
- Examples - Real-world applications
- API Reference - Complete API documentation
Local Documentation
pip install "fast-django[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
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests and linting (
pytest && ruff check . && mypy src) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - 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
- 📚 Documentation: https://aakarsharma.github.io/fast-django/
- 🐛 Bug Reports: GitHub Issues
- 💬 Discussions: GitHub Discussions
- 📧 Contact: Create an issue
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- FastAPI - The web framework for building APIs
- Tortoise ORM - The async ORM
- Aerich - Database migrations
- FastAPI-Admin - Admin interface
- Django - Inspiration for developer experience
Made with ❤️ by the fast-django community
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fast_django_asgi-0.1.2.tar.gz.
File metadata
- Download URL: fast_django_asgi-0.1.2.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e10d21bcdce317d4544d418d681b9ecbd83751bdca2fa89733f769f90a88c86c
|
|
| MD5 |
1d6cd1cb007a2e4662d15d31bbc9b4b8
|
|
| BLAKE2b-256 |
58162a24e1fc9836bc046d3f878f2fa163f665f682f5d6420af5d2af0a322937
|
File details
Details for the file fast_django_asgi-0.1.2-py3-none-any.whl.
File metadata
- Download URL: fast_django_asgi-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb018257d3dc39e83313d83752f02a5cc6b8545fd163fb319c2d713f4498573f
|
|
| MD5 |
953f2fffeef5763ffeae014ce8ca87c2
|
|
| BLAKE2b-256 |
523b9357b1cf0f50e831122fa5df3858911b281b694ef5a44599ab9b300bc36b
|