PluginBench
Rule

htmx django

via PatrickJS/awesome-cursorrules

HTMX development with Django integration best practices and patterns.

What is htmx django?

This rule provides guidance for building interactive web applications by combining HTMX with Django. Use it when building dynamic, partial-page-update features in Django projects, leveraging Django's template system, forms, ORM, and class-based views alongside HTMX attributes.

  • Integrate HTMX attributes with Django's template system
  • Handle forms and CSRF protection using Django's built-in features
  • Route HTMX requests through Django's URL routing and class-based views
  • Validate form submissions with Django's form validation
  • Manage database operations via Django ORM within HTMX responses
  • Structure projects following Django conventions with templates and static assets

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

HTMX development with Flask integration best practices and patterns.

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

Go development with HTMX for server-side rendered interactive web applications.

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

Go Fiber best practices for building HTMX-driven web applications.

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

Senior Java developer persona with Effective Java principles, SOLID, and functional programming best practices.

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

Java Spring Boot 3 with JPA/Hibernate development guide following SOLID principles and OWASP best practices.

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

Expert guidance for building fast, scalable web apps with Astro, JavaScript, and Tailwind CSS.

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