PluginBench
Rule

htmx django

via PatrickJS/awesome-cursorrules

HTMX development with Django integration, templates, and best practices.

What is htmx django?

This rule provides guidance for building interactive web applications using HTMX with Django. It covers template integration, form handling, URL routing, class-based views, and proper CSRF protection to streamline HTMX-Django development workflows.

  • Use Django's template system with HTMX attributes for dynamic interactions
  • Implement Django forms and ORM for form handling and database operations
  • Utilize Django's class-based views and URL routing for HTMX responses
  • Apply Django's middleware and CSRF protection for secure request/response processing
  • Manage static assets with Django's staticfiles app and proper project structure
  • Implement error handling, logging, and form validation for HTMX requests

Applies to

File patterns this rule matches.

**/*
Rule definition (reference)

Source of truth, from the repository.

// 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 `;

Related rules

Senior full-stack TypeScript, React, Node.js guidance with clean architecture, testing, and WHY-oriented reasoning.

**/*
41k
via PatrickJS/awesome-cursorrules

Quantitative factor research skills for designing, evaluating, and mining alpha factors in equities markets.

**/*
41k
via PatrickJS/awesome-cursorrules

Android development with Jetpack Compose, clean architecture, and Material Design 3.

**/*
41k
via PatrickJS/awesome-cursorrules

Angular development with Novo Elements UI library using standalone components.

**/*
41k
via PatrickJS/awesome-cursorrules

Expert Angular 18 + TypeScript development with Jest, emphasizing clean code and performance.

**/*
41k
via PatrickJS/awesome-cursorrules

Manage Kubernetes clusters, add-ons, stacks, and credentials via the Ankra CLI platform.

**/*.sh +5
41k
via PatrickJS/awesome-cursorrules