Generate production-ready Django microservices for Buildly Core in minutes.
The Django Service Wizard is an interactive command-line tool that scaffolds complete Django microservices with best practices, Docker support, API documentation, and seamless Buildly Core integration. No more manual setup - just describe your service and get a fully configured project ready for development.
The wizard creates a complete Django microservice with:
- ποΈ Django Project Structure - Properly organized settings, apps, and configurations
- π³ Docker Support - Dockerfile, docker-compose.yml, and production-ready containers
- π API Documentation - Swagger/OpenAPI integration with interactive docs
- π§ Buildly Core Integration - Pre-configured for seamless service discovery
- β‘ Health Checks - Built-in health monitoring endpoints
- π Security - JWT authentication, CORS, and permission handling
- π CI/CD Ready - Travis CI configuration and Docker registry support
- π οΈ Development Tools - Gunicorn, static files handling, and environment configs
- Docker and docker-compose
- 2GB+ available disk space
- Internet connection for downloading dependencies
# Clone or navigate to the django-service-wizard directory
cd django-service-wizard
# Run the interactive wizard
docker-compose run --rm django_service_wizard
# Follow the prompts:
# 1. Service name (e.g., "customer_service")
# 2. Application name (e.g., "customer")
# 3. Docker support? (Y/n)
# 4. Travis CI? (y/N)
# 5. Swagger docs? (Y/n)
# 6. Service display name (e.g., "Customer Management Service")
# 7. Service description
# Your new service is ready!Welcome to the Buildly Core (Micro)Service wizard!
_ _ _ _ _
| |__ _ _(_) | __| | |_ _
| '_ \| | | | | |/ _` | | | | |
| |_) | |_| | | | (_| | | |_| |
|_.__/ \__,_|_|_|\__,_|_|\__, |
|___/
Type in the name of your service (e.g.: appointments_service): customer_service
β
The Django project "customer_service" was successfully created
Type in the name of your application (e.g.: appointment): customer
β
Django application "customer" was successfully created
Add Docker support? (y/N): y
β
Docker support added successfully
Add travis CI test support? (y/N): n
Add Swagger docs? (Y/n): y
Type in the displayed Name of your service: Customer Management Service
Type in the description of your service: A microservice for managing customer data and profiles
β
Great! Your new project "customer_service" is ready!
customer_service/
βββ π README.md # Project documentation
βββ π³ Dockerfile # Production container
βββ π³ docker-compose.yml # Development environment
βββ βοΈ manage.py # Django management
βββ π requirements/ # Dependencies
β βββ base.txt # Core requirements
β βββ production.txt # Production requirements
βββ π customer/ # Django application
β βββ __init__.py
β βββ admin.py # Django admin
β βββ apps.py # App configuration
β βββ models.py # Database models
β βββ serializers.py # API serializers
β βββ views.py # API views
β βββ urls.py # URL routing
β βββ migrations/ # Database migrations
βββ π customer_service/ # Project configuration
β βββ __init__.py
β βββ permissions.py # Custom permissions
β βββ gunicorn_conf.py # Gunicorn configuration
β βββ urls.py # Main URL configuration
β βββ wsgi.py # WSGI application
β βββ settings/ # Settings modules
β βββ __init__.py
β βββ base.py # Base settings
β βββ production.py # Production settings
βββ π§ scripts/ # Utility scripts
β βββ run-collectstatic.sh # Static files collection
β βββ run-tests.sh # Test runner
β βββ wait-for-it.sh # Service dependency waiting
βββ π .travis.yml # CI/CD configuration (optional)
- Modular Settings - Separate base and production configurations
- Application Structure - Clean separation of concerns
- Database Ready - PostgreSQL configuration with environment variables
- Static Files - Proper handling for production deployment
- Multi-stage Build - Optimized container sizes
- Development Mode - Hot reload and debugging support
- Production Ready - Gunicorn, security headers, static files
- Health Checks - Container health monitoring
- Swagger UI - Interactive API documentation at
/swagger/ - ReDoc - Alternative documentation view at
/redoc/ - Schema Generation - Automatic OpenAPI schema from Django models
- Authentication - JWT token support in documentation
- Buildly Core Integration - Seamless JWT authentication
- CORS Configuration - Cross-origin resource sharing setup
- Permission Classes - Custom permission handling
- Environment Variables - Secure configuration management
docker-compose run --rm django_service_wizard
# Minimal setup - just Django + Docker
Service name: inventory_service
App name: inventory
Docker support: Y
Travis CI: N
Swagger docs: Ydocker-compose run --rm django_service_wizard
# Complete setup with CI/CD
Service name: order_processing_service
App name: order
Docker support: Y
Travis CI: Y
Docker registry: Y
Registry domain: hub.docker.com
Registry folder: mycompany
Swagger docs: Y# Generate service in specific directory
docker-compose run --rm \
-v "/path/to/output:/code" \
django_service_wizarddocker-compose run --rm django_service_wizardcd your_service_name
docker-compose up -d
# Your service is now running at:
# - API: http://localhost:8000/
# - Swagger: http://localhost:8000/swagger/
# - Admin: http://localhost:8000/admin/# your_service/your_app/models.py
from django.db import models
class Customer(models.Model):
name = models.CharField(max_length=100)
email = models.EmailField()
created_at = models.DateTimeField(auto_now_add=True)# your_service/your_app/serializers.py
from rest_framework import serializers
from .models import Customer
class CustomerSerializer(serializers.ModelSerializer):
class Meta:
model = Customer
fields = '__all__'
# your_service/your_app/views.py
from rest_framework import viewsets
from .models import Customer
from .serializers import CustomerSerializer
class CustomerViewSet(viewsets.ModelViewSet):
queryset = Customer.objects.all()
serializer_class = CustomerSerializerThe generated service is pre-configured to work with Buildly Core's service discovery and authentication.
# Inside your generated service directory
docker-compose exec web python manage.py test
# Or using the provided script
docker-compose exec web ./scripts/run-tests.sh# Test the wizard code
docker-compose run --entrypoint 'python -m unittest discover' --rm django_service_wizard
# Build and test
docker-compose build
docker-compose run --rm django_service_wizard --help- Docker - Multi-stage Dockerfile with production optimizations
- Settings - Django settings split for different environments
- Scripts - Utility scripts for deployment and maintenance
- CI/CD - Travis CI configuration with Docker registry support
- Documentation - README template with service-specific content
Edit files in service_builder/templates/ to customize the generated output:
service_builder/templates/
βββ conf/gunicorn_conf.py # Gunicorn configuration
βββ docker/Dockerfile # Container definition
βββ readme/README.md # Project documentation template
βββ requirements/base.txt # Python dependencies
βββ scripts/ # Utility scripts
βββ settings/ # Django settings templates# Database Configuration
DATABASE_ENGINE=django.db.backends.postgresql
DATABASE_NAME=your_service_db
DATABASE_USER=your_user
DATABASE_PASSWORD=your_password
DATABASE_HOST=localhost
DATABASE_PORT=5432
# Buildly Core Integration
BUILDLY_CORE_URL=http://buildly-core:8080
JWT_SECRET_KEY=your-jwt-secret
# Django Configuration
DEBUG=False
SECRET_KEY=your-secret-key
ALLOWED_HOSTS=localhost,127.0.0.1# docker-compose.override.yml (in generated service)
version: '3.7'
services:
web:
environment:
- DEBUG=True
volumes:
- .:/code
ports:
- "8000:8000"# Build production image
docker build -t your-service:latest .
# Run in production
docker run -d \
--name your-service \
-p 8000:8000 \
-e DATABASE_URL=postgresql://... \
your-service:latestapiVersion: apps/v1
kind: Deployment
metadata:
name: your-service
spec:
replicas: 3
selector:
matchLabels:
app: your-service
template:
metadata:
labels:
app: your-service
spec:
containers:
- name: web
image: your-service:latest
ports:
- containerPort: 8000- Getting Started Guide - Detailed tutorial with examples
- Template Reference - Customizing generated code
- Buildly Integration - Service discovery and authentication
- Deployment Guide - Production deployment strategies
We welcome contributions! Here's how you can help:
- Report Bugs - Found an issue? Open a GitHub issue
- Improve Templates - Enhance the generated code templates
- Add Features - New wizard options or integrations
- Documentation - Help improve our guides and examples
# Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/django-service-wizard.git
cd django-service-wizard
# Make changes to templates or wizard code
# Test your changes
docker-compose build
docker-compose run --rm django_service_wizard
# Submit a Pull Request- Docker 20.10+ and docker-compose 1.29+
- Python 3.8+ (for development)
- Git (for version control)
- Django 4.2+ (specified in requirements/base.txt)
- PostgreSQL 12+ (recommended database)
- Redis (for caching, optional)
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation - Check our docs folder for detailed guides
- GitHub Issues - Report bugs and request features
- Community - Join the Buildly Discord community
- Professional Support - Contact enterprise@buildly.io
Ready to build your first microservice? Get started now! π