> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coderabbit.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Django example configuration

> A .coderabbit.yaml for a Django project: review instructions for model validation, QuerySet performance and docstrings, and a separate rule for tests.

This example configures CodeRabbit for a Python project built with Django. It uses schema V2. Its review instructions ask for complete docstrings, `QuerySet` optimizations and a `full_clean()` call before every `save()`, and tell CodeRabbit that test data isn't sensitive. Copy it to the root of your repository as `.coderabbit.yaml` and adjust the instructions to your project.

```yaml .coderabbit.yaml theme={null}
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
language: "en-US"
early_access: false
reviews:
  profile: "chill"
  auto_approvals:
    enabled: false
  high_level_summary: true
  poem: true
  review_status: true
  collapse_walkthrough: false
  auto_review:
    enabled: true
    drafts: false
  path_instructions:
    - path: "**/*.py"
      instructions: |
        Review the following code using Python Django. Ensure that:
          - Ensure each method has a clear, detailed docstring explaining its purpose, parameters, and return values. Enhance existing docstrings for clarity and completeness.
          - Do not suggest adding type annotations.
          - Review Django querysets for potential performance improvements and suggest optimizations where applicable.
          - Ensure that for every model.save() there is a model.full_clean() that precedes it.
          - Avoid adding generic exception handling (e.g., `except Exception`) in test files. Each test failure should be addressed by the developer with specific exception handling or fixes.
          - Avoid adding comments relating to importing modules.
    - path: "tests/*.py"
      instructions: |
        - There is no sensitive information in the test files. All data handled is procedural/generic and non-sensitive.
chat:
  auto_reply: true
```

## What's next

> [card] [Review instructions](https://docs.coderabbit.ai/pr-reviews/review-instructions.md)
>
> Write and scope the instructions this example sets in `path_instructions`.

> [card] [Review style](https://docs.coderabbit.ai/pr-reviews/review-style.md)
>
> Choose a review profile other than `chill`.

> [card] [Control when reviews run](https://docs.coderabbit.ai/pr-reviews/when-reviews-run.md)
>
> Tune the `auto_review` settings, such as reviewing draft pull requests.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.