Django Cursor Rules Starter (Free)

Three Django rules that fix the mistakes agents make most often, ready to drop into .cursor/rules/, plus a linter.

Django Cursor Rules Starter (Free) cover

What it is

3 Cursor project rules for Django you can drop into a repo today, plus lint_rules.py, which tells you why a Cursor rule isn't loading.

What you get

The screenshot is real output from the kit’s own commands. Tested from a fresh download of this exact zip: ./run_tests.sh ran 5 tests OK on Python 3.13 and 3.10.

Real terminal output from Django Cursor Rules Starter: demo and passing tests

The rules (in .cursor/rules/)

RuleLoadsFirst instruction
django-overview.mdcalwaysCheck the Django version (requirements/pyproject/lockfile) before using an API
django-models-orm.mdcby file (/models.py, /models/*.py, /managers.py, /services.py)Avoid N+1 queries: select_related() for ForeignKey/OneToOne, prefetch_related() for reverse and many-to-many
django-security.mdcby file (/settings.py, /settings/*.py)Production: DEBUG = False, explicit ALLOWED_HOSTS, SECRET_KEY from the environment, SECURE_SSL_REDIRECT,...

Install

Copy .cursor/rules/ into your project root (keep the .mdc extension). Then check them against your code:

python3 tools/lint_rules.py .cursor/rules --project .
./tools/demo.sh        # copies the rules into examples/sample-app and lints them
./run_tests.sh

Honest limits

  • Rules guide the model; they don't enforce anything.
  • Check version-specific advice against your installed versions.

Format and license

Zip, 12 KB, v1.0, 21 files. Free to use, modify and share for any purpose, including commercial work, as long as this notice stays in copies. Not affiliated with or endorsed by Cursor (Anysphere) or the Django Software Foundation.

FAQ

Django 5.2 or 6.0?
Both; 6.0-only features (Tasks, CSP, partials) are labeled, and the overview tells the agent to check your version.
Is it really free?
Yes, free to use, change and share.
What's in the paid pack?
10 rules covering models and N+1, migrations, views and permissions, forms, security settings and CSP, templates and partials, background tasks, DRF and tests.
How do I get the files?
Click Download free. The zip downloads straight away: no checkout, no account.
Do I have to sign up for the newsletter?
No. The form is optional and the download works without it.

Get Django Cursor Rules Starter (Free)

Free Django Cursor rules in .mdc format, checked against current Django docs, plus a linter that shows why a rule isn't applying.

Pairs well with

Download$12

Cursor Rules for Rails

9 Cursor rules for Rails (Active Record and more), written against current docs. Installs in one command, exports AGENTS.md. $12 once.

View Cursor Rules for Rails
DownloadFree

Rails Cursor Rules Starter (Free)

Free Rails Cursor rules in .mdc format, checked against current Rails docs, plus a linter that shows why a rule isn't applying.

View Rails Cursor Rules Starter (Free)
Download$12

Cursor Rules for Supabase

8 Cursor rules for Supabase (Row Level Security policies and more), written against current docs. Installs in one command, exports AGENTS.md. $12 once.

View Cursor Rules for Supabase

Related