Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

django_devops

БесплатноБез исполняемых скриптовНе проверен

Enterprise Django 6 DevOps — containerization, CI/CD, environment management, database deployment, monitoring, and production readiness checklist.

diegosouzapwот diegosouzapw★ 68 звёзд на GitHub

Об этом скилле

Django DevOps Skill

Purpose

Define and enforce DevOps standards for building, deploying, monitoring, and operating enterprise Django 6 systems with Strawberry GraphQL, SSE, Celery, Redis, and PostgreSQL.

Scope

  • Containerization (Docker)
  • CI/CD pipeline design
  • Environment management
  • Database migration deployment
  • Health checks and readiness probes
  • Logging and monitoring
  • Secrets management in deployments
  • Scaling and resource allocation
  • Backup and disaster recovery

Responsibilities

  1. ENFORCE containerized deployments.
  2. ENFORCE CI/CD with automated testing and migration validation.
  3. ENFORCE environment parity across development, staging, and production.
  4. ENFORCE structured logging and monitoring.
  5. ENFORCE health check endpoints for orchestrators.
  6. PREVENT manual deployments without CI/CD.
  7. PREVENT unreviewed migrations in production.
  8. PREVENT secret leakage in CI/CD logs or Docker images.

Mandatory Rules

ALWAYS

  1. ALWAYS containerize the application with a multi-stage Dockerfile:
    # Stage 1: Builder
    FROM python:3.12-slim AS builder
    WORKDIR /app
    COPY requirements.txt .
    RUN pip install --no-cache-dir --prefix=/install -r requirements.txt
    
    # Stage 2: Runtime
    FROM python:3.12-slim
    WORKDIR /app
    COPY --from=builder /install /usr/local
    COPY . .
    RUN python manage.py collectstatic --noinput
    EXPOSE 8000
    CMD ["gunicorn", "CMS.asgi:application", "-k", "uvicorn.workers.UvicornWorker", "--bind", "0.0.0.0:8000"]
    
  2. ALWAYS use ASGI server (Uvicorn/Daphne/Hypercorn) for production. Never use Django's runserver.
  3. ALWAYS implement health check endpoints:
    # urls.py
    path('health/', HealthCheckView.as_view(), name='health-check'),
    path('health/ready/', ReadinessCheckView.as_view(), name='readiness-check'),
    
    • Liveness (/health/): Returns 200 if the process is alive.
    • Readiness (/health/ready/): Returns 200 if DB, Redis, and Celery are reachable.
  4. ALWAYS run migrations as a separate step in deployment, BEFORE starting new application instances:
    # CI/CD Pipeline
    steps:
      - name: Run migrations
        run: python manage.py migrate --noinput
      - name: Deploy new version
        run: kubectl rollout restart deployment/cms-api
    
  5. ALWAYS validate migrations in CI before deployment:
    python manage.py makemigrations --check --dry-run  # Fail if unapplied migrations exist
    python manage.py migrate --plan                     # Show migration plan
    
  6. ALWAYS use environment variables for all configuration. Never bake configuration into Docker images.
  7. ALWAYS use .dockerignore to exclude .git, __pycache__, .env, node_modules, media files.
  8. ALWAYS tag Docker images with the Git commit SHA, not latest:
    docker build -t cms-backend:$(git rev-parse --short HEAD) .
    
  9. ALWAYS use structured JSON logging in production:
    LOGGING = {
        'version': 1,
        'formatters': {
            'json': {
                '()': 'pythonjsonlogger.jsonlogger.JsonFormatter',
                'format': '%(asctime)s %(name)s %(levelname)s %(message)s',
            },
        },
        'handlers': {
            'console': {
                'class': 'logging.StreamHandler',
                'formatter': 'json',
            },
        },
        'root': {
            'handlers': ['console'],
            'level': 'INFO',
        },
    }
    
  10. ALWAYS monitor these metrics:
    • Request latency (p50, p95, p99)
    • Error rate (5xx responses)
    • Database query count and latency
    • Redis connection pool usage
    • Celery task queue depth and processing time
    • SSE active connection count
    • Memory and CPU usage per container
  11. ALWAYS define resource limits for containers:
    resources:
      requests:
        memory: "256Mi"
        cpu: "250m"
      limits:
        memory: "512Mi"
        cpu: "500m"
    
  12. ALWAYS implement graceful shutdown — handle SIGTERM to finish in-flight requests:
    # Uvicorn handles this natively with --timeout-graceful-shutdown
    CMD ["uvicorn", "CMS.asgi:application", "--host", "0.0.0.0", "--port", "8000", "--timeout-graceful-shutdown", "30"]
    

NEVER

  1. NEVER use runserver in production.
  2. NEVER bake secrets into Docker images.
  3. NEVER deploy without running the test suite in CI.
  4. NEVER run migrations and application startup in the same process simultaneously.
  5. NEVER use DEBUG=True in production.
  6. NEVER expose database ports to the public internet.
  7. NEVER use latest tag for Docker images in production deployments.
  8. NEVER skip health checks in orchestrator configuration.
  9. NEVER log request/response bodies in production (PII risk).
  10. NEVER store persistent data in container filesystems (ephemeral).

CI/CD Pipeline

Pipeline Stages

1. Lint        → ruff check, ruff format --check
2. Tes
Полный SKILL.md на GitHub

Установить django_devops в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

metadata.json

FAQ

Что делает скилл django_devops?

Enterprise Django 6 DevOps — containerization, CI/CD, environment management, database deployment, monitoring, and production readiness checklist.

Как установить скилл django_devops?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл django_devops запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить django_devops с