django
Skill: Django
Best practices for Django web development including models, views, templates, and testing.
When to Use
Apply this skill when working with Django projects — models, views, URL routing, templates, forms, admin, and management commands.
Project Structure
- Follow the standard Django app layout:
models.py,views.py,urls.py,admin.py,tests.py,forms.py. - Keep each app focused on a single domain concept; avoid "god apps" with unrelated models.
- Use
settings/base.py,settings/dev.py,settings/prod.pyfor environment-specific configuration.
Models
- Always define
__str__on models for admin and debugging readability. - Use
Meta.orderingsparingly — it addsORDER BYto every query. Prefer explicit.order_by()on querysets. - Use database indexes (
db_index=True,Meta.indexes) for fields that appear infilter()/order_by().
More from microsoft/debugpy
pytest
Best practices for writing and organizing tests with pytest including fixtures, parametrize, and plugins.
8jinja2
Best practices for template rendering with Jinja2 including environments, filters, autoescaping, and security.
8requests
Best practices for HTTP client usage with Requests including sessions, error handling, and timeouts.
6flask
Best practices for Flask web development including routing, blueprints, and testing.
6numpy
Best practices for numerical computing with NumPy including arrays, broadcasting, and vectorization.
4click
Best practices for building CLI applications with Click including commands, groups, options, and testing.
3