BMAD-METHOD/.claude/rules/python-django-best-practice.../django-views.mdc

7 lines
476 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
description: Specific guidelines for Django views, focusing on class-based vs. function-based views, error handling, and request handling.
globs: **/views.py
---
- Use Djangos class-based views (CBVs) for more complex views; prefer function-based views (FBVs) for simpler logic.
- Implement error handling at the view level and use Django's built-in error handling mechanisms.
- Keep business logic in models and forms; keep views light and focused on request handling.