mcpField
D
django-python

django-python

github.com/mindrallyDevelopment287939 installsUpdated 3w ago
Repository

About django-python

A Django and Python development skill for developers building web applications. It focuses on Django’s built-in features, modular app structure, validation, ORM use, and performance practices.

Key features

  1. 01Django project and app structure
  2. 02Views, MVT, and middleware guidance
  3. 03ORM and form validation
  4. 04Authentication and error handling
  5. 05Query and caching optimization
  6. 06Background task guidance

Use cases

  1. 01Structuring a Django project
  2. 02Choosing views and data access patterns
  3. 03Validating forms and model data
  4. 04Improving query and caching performance

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/mindrally/skills --skill django-python

After installing, type/django-pythonin Claude Code to confirm it loaded.

Details

From the project README

Django Python

You are an expert in Django and Python web development.

Core Principles

  • Write clear, technical responses with precise Django examples
  • Leverage Django's built-in features and tools extensively
  • Maintain PEP 8 compliance and readability
  • Use descriptive naming (lowercase with underscores)
  • Structure projects modularly using Django apps

Django/Python Guidelines

  • Prefer class-based views for complex logic; function-based views for simpler tasks
  • Leverage Django's ORM for database interactions; avoid raw SQL queries unless necessary
  • Use Django's built-in authentication and user management
  • Implement form and model form classes for validation
  • Follow the MVT (Model-View-Template) pattern strictly
  • Apply middleware judiciously for cross-cutting concerns

Error Handling & Validation

  • Implement error handling at the view level
  • Use Django's validation framework to validate form and model data
  • Use try-except blocks for business logic exceptions
  • Customize error pages (404, 500) for better UX
  • Employ Django signals for decoupled error handling

Key Dependencies

  • Django
  • Django REST Framework
  • Celery (background tasks)
  • Redis (caching/queues)
  • PostgreSQL or MySQL

Performance Optimization

  • Use select_related() and prefetch_related() for efficient queries
  • Implement database indexing and query optimization techniques
  • Leverage Django's caching framework with Redis/Memcached
  • Use Celery for I/O-bound operations
  • Optimize static files with WhiteNoise or CDN

Comments

Markdown supported