Home › All rules › Community › Htmx Django Cursor Rules

Htmx Django Cursor Rules

Cursor rules for HTMX development with Django integration.

CursorhtmxCommunity (CC0)

How to use

Save this as .cursor/rules/htmx-django-cursorrules-prompt-file.mdc in your project, commit it, and Cursor will load it. Review it first: community files can be opinionated or out of date.

Note: Review and test before use. Provided as is, without warranty. See Terms.

.cursor/rules/htmx-django-cursorrules-prompt-file.mdcDownload  
---
description: "Cursor rules for HTMX development with Django integration."
globs: **/*
alwaysApply: false
---
// HTMX with Django .cursorrules

// HTMX and Django best practices

const htmxDjangoBestPractices = [
  "Use Django's template system with HTMX attributes",
  "Implement Django forms for form handling",
  "Utilize Django's URL routing system",
  "Use Django's class-based views for HTMX responses",
  "Implement Django ORM for database operations",
  "Utilize Django's middleware for request/response processing",
];

// Folder structure

const folderStructure = `
project_name/
  app_name/
    templates/
    static/
      css/
      js/
    models.py
    views.py
    urls.py
  project_name/
    settings.py
    urls.py
manage.py
`;

// Additional instructions

const additionalInstructions = `
1. Use Django's template tags with HTMX attributes
2. Implement proper CSRF protection with Django's built-in features
3. Utilize Django's HttpResponse for HTMX-specific responses
4. Use Django's form validation for HTMX requests
5. Implement proper error handling and logging
6. Follow Django's best practices for project structure
7. Use Django's staticfiles app for managing static assets
`;

More: htmx rules · all community rules

Related rules

htmx + server-rendered HTML AGENTS.md

AGENTS.md for htmx 2 apps with server-rendered templates (any backend), partials, and progressive enhancement.

AGENTS.mdhtmx

Htmx Basic Cursor Rules

Cursor rules for HTMX development with basic setup.

CursorhtmxCommunity (CC0)

Htmx Flask Cursor Rules

Cursor rules for HTMX development with Flask integration.

CursorhtmxCommunity (CC0)

Htmx Go Basic Cursor Rules

Cursor rules for Go development with basic setup.

CursorhtmxCommunity (CC0)

Htmx Go Fiber Cursor Rules

Cursor rules for Go development with Fiber integration.

CursorhtmxCommunity (CC0)

Get new rules weekly

One email a week: fresh rule files, agent tips, and what's changing in Cursor, Claude Code and Copilot. Free, unsubscribe anytime.

Opens the Rulestack Newsletter on beehiiv in a new tab. Or subscribe directly on beehiiv.