Django
Professional-grade Agentic Skills for modern software engineering. Built from real-world best practices, official documentation, and production experience.
npx -y skills add GNSubrahmanyam/agentic-skills --skill djangoAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Comprehensive Django development framework with prioritized rules across models, views, templates, security, and performance. Use when building Django applications, writing models, creating views, implementing authentication, or optimizing Django projects.
SKILL.md
7.6 KB, as published. Nobody here has run it
Django Development Best Practices
Comprehensive performance and development optimization guide for Django applications, containing 60+ rules across 9 categories, prioritized by impact to guide automated development and code generation.
When to Apply
Reference these guidelines when:
- Building new Django applications or features
- Writing models, views, templates, or forms
- Implementing authentication and security
- Optimizing database queries and performance
- Setting up testing and deployment
- Reviewing Django code for best practices
- Customizing admin interfaces and URL configurations
- Implementing caching strategies and middleware
- Working with static files and media uploads
- Understanding Django signals and advanced patterns
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Security & Authentication | CRITICAL | security- |
| 2 | Database & Models | CRITICAL | db- |
| 3 | Views & URLs | HIGH | views- |
| 4 | Forms | HIGH | forms- |
| 5 | Templates | MEDIUM-HIGH | templates- |
| 6 | Authentication & Authorization | MEDIUM-HIGH | auth- |
| 7 | APIs | MEDIUM-HIGH | api- |
| 8 | URLs & Admin | MEDIUM-HIGH | urls- / admin- |
| 9 | Email & Tasks | MEDIUM-HIGH | email- / background- |
| 10 | Testing | MEDIUM-HIGH | testing- |
| 11 | Performance & Caching | MEDIUM | perf- / caching- |
| 12 | Deployment | MEDIUM | deploy- |
| 13 | Advanced Patterns | LOW | advanced- |
Quick Reference
1. Security & Authentication (CRITICAL)
security-csrf-protection: Always enable CSRF protection for formssecurity-sql-injection: Use parameterized queries and ORM methodssecurity-xss-prevention: Escape user input in templatessecurity-https-only: Force HTTPS in productionsecurity-password-hashing: Use Django's password hashingsecurity-session-security: Secure session configurationsigning-cryptography: Secure data signing for integrity and tamper prevention
2. Database & Models (CRITICAL)
db-migration-safety: Never modify migrations manuallydb-indexes-strategy: Add indexes for frequently queried fieldsdb-foreign-key-protection: Use on_delete appropriatelydb-n-plus-one-queries: Use select_related and prefetch_relateddb-constraints-validation: Use model and database constraintsdb-transaction-management: Wrap related operations in transactions
3. Views & URLs (HIGH)
views-function-vs-class: Choose appropriate view typeviews-http-methods: Handle HTTP methods correctlyviews-error-handling: Implement proper error responsesviews-pagination: Use Django's pagination for large datasetsviews-caching-strategy: Implement appropriate caching layersviews-api-serialization: Use proper serialization for APIsexceptions-error-handling: Proper exception handling and error viewshttp-request-response: Handling HttpRequest and HttpResponse objects
4. Forms (HIGH)
forms-modelform-usage: Prefer ModelForm for model-backed formsforms-validation-logic: Implement custom validation methodsforms-security-cleaning: Always clean and validate form dataforms-error-display: Provide clear error messages to usersforms-file-handling: Handle file uploads securelyforms-formsets-usage: Use formsets for multiple related formsvalidators: Built-in and custom validators for data validation
5. Templates (MEDIUM-HIGH)
templates-inheritance-pattern: Use template inheritance for DRY templatestemplates-context-data: Keep templates simple, logic in viewstemplates-filters-security: Use safe filters carefullytemplates-static-files: Manage static files properlytemplates-internationalization: Implement i18n supporttemplates-performance: Minimize template rendering overhead
6. Authentication & Authorization (MEDIUM-HIGH)
auth-user-management: Implement secure user authenticationauth-permissions-groups: Use Django's permission systemauth-custom-user-model: Extend user model when neededauth-session-security: Secure session handlingauth-password-security: Password management best practicesauth-social-auth: Third-party authentication integration
7. URLs & Admin (MEDIUM-HIGH)
urls-configuration-patterns: Organize URL patterns effectivelyurls-reverse-urls: Use reverse() for URL generationurls-namespaces: Implement URL namespaces and app namesadmin-customization: Customize Django admin interfaceadmin-actions-filters: Add custom admin actions and filtersadmin-security: Secure admin interface access
6. Testing (MEDIUM-HIGH)
testing-unit-vs-integration: Write appropriate test typestesting-fixtures-usage: Use fixtures for test datatesting-mocking-strategy: Mock external dependenciestesting-coverage-goals: Maintain high test coveragetesting-django-testcase: Use Django's TestCase subclassestesting-factory-pattern: Use factories for complex test data
7. Performance (MEDIUM)
perf-query-optimization: Optimize database queriesperf-caching-strategy: Implement multiple caching layersperf-static-file-optimization: Optimize static file servingperf-database-indexing: Use appropriate database indexesperf-middleware-optimization: Order middleware efficientlyperf-async-support: Use async views where appropriateasync-views-tasks: Asynchronous operations and background tasksfiles-media-handling: File uploads and storage management
8. Deployment (MEDIUM)
deploy-environment-separation: Separate development and productiondeploy-secret-management: Securely manage secrets and keysdeploy-static-files-serving: Configure static file servingdeploy-database-configuration: Optimize database settingsdeploy-monitoring-setup: Implement logging and monitoringdeploy-backup-strategy: Implement data backup proceduressettings-management: Django settings configuration and environment variables
9. Advanced Patterns (LOW)
advanced-signals-usage: Use signals appropriatelyadvanced-middleware-custom: Implement custom middlewareadvanced-model-managers: Create custom model managersadvanced-generic-views: Extend generic views properlyadvanced-admin-customization: Customize admin interfaceadvanced-internationalization: Implement advanced i18n featuresmiddleware-basics: Middleware concepts and custom middleware creationunicode-text-handling: Encoding and text processing for international apps
How to Use
Read individual rule files for detailed explanations and code examples:
rules/security-csrf-protection.md
rules/db-migration-safety.md
rules/views-function-vs-class.md
rules/auth-user-management.md
rules/admin-customization.md
rules/caching-strategy.md
Each rule file contains:
- Impact level and category
- Problem description
- Solution with code examples
- Common mistakes to avoid
- When to apply the rule
Reference Documentation
Detailed guides for complex topics:
references/workflows.md # Development workflow patterns
references/middleware-signals.md # Middleware and signals implementation
references/deployment-static.md # Static files, media, and deployment
Full Compiled Document
For the complete Django best practices guide with all rules expanded: AGENTS.md