views
From davila7
Create Django views with proper structure and best practices.
Install
/viewsFacts
- Repository
- davila7/claude-code-templates
- Status
- Actively maintained
- Last commit
Source preview
The instructions Claude Code reads when this command runs.
# Django Views Generator
Create Django views with proper structure and best practices.
## Purpose
This command helps you quickly create Django views (Function-Based Views and Class-Based Views) following Django conventions.
## Usage
```
/views
```
## What this command does
1. **Creates view functions/classes** with proper structure
2. **Handles HTTP methods** (GET, POST, PUT, DELETE)
3. **Includes form handling** and validation
4. **Adds authentication/authorization** checks
5. **Follows Django best practices** and security guidelines
## Example Output
```python
# views.py
from django.shortcuts import render, get_object_or_404, redirect
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from django.http import JsonResponse
from django.views.generic import ListView, DetailView, CreateView, UpdateView, DeleteView
from django.contrib.auth.mixins import LoginRequiredMixin
from django.urls import reverse_lazy
from .models import Post, Category
from .forms import PostForm
# Function-Based Views
def post_list(request):
"""Display list of posts with pagination and filtering."""
posts = Post.objects.filter(status='published').select_related('author', 'category')
# Search functionality
search_query = request.GET.get('search')
if search_query:
posts = posts.filter(title__icontains=search_query)
View full source on GitHub →Other slash commands
feature-development
★ 229,918Workflow command scaffold for feature-development in everything-claude-code.
affaan-mupdated 14d agoMITdatabase-migration
★ 229,918Workflow command scaffold for database-migration in everything-claude-code.
affaan-mupdated 14d agoMITadd-language-rules
★ 229,918Workflow command scaffold for add-language-rules in everything-claude-code.
affaan-mupdated 14d agoMITcommit-push-pr
★ 137,934Commit, push, and open a PR
anthropicsupdated 13d agodedupe
★ 137,934Find duplicate GitHub issues
anthropicsupdated 13d agotriage-issue
★ 137,934Triage GitHub issues by analyzing and applying labels
anthropicsupdated 13d ago