django
$
npx mdskill add partme-ai/full-stack-skills/djangoGuides developers through Django web application creation, covering models, views, templates, REST APIs, and deployment.
- Helps with building web applications, implementing models and views, and configuring projects and deployment.
- Integrates with Django framework tools like django-admin, manage.py, and Django REST Framework.
- Decides recommendations based on user queries about Django, project creation, or API development needs.
- Presents results through step-by-step workflows, code examples, and guidance on testing and production settings.
SKILL.md
.github/skills/djangoView on GitHub ↗
---
name: django
description: "Provides comprehensive guidance for Django framework including models, views, templates, forms, admin, REST framework, and deployment. Use when the user asks about Django, needs to create web applications, implement models and views, or build Django REST APIs."
license: Complete terms in LICENSE.txt
---
## When to use this skill
Use this skill whenever the user wants to:
- Create Django web applications with models, views, and templates
- Configure projects, apps, migrations, and deployment
- Build REST APIs with Django REST Framework
- Set up Django admin, forms, and authentication
## How to use this skill
### Workflow
1. **Create project** — scaffold with `django-admin startproject`
2. **Add apps** — create feature apps with `python manage.py startapp`
3. **Define models** — write models, create and run migrations
4. **Build views and URLs** — implement views, wire URL patterns
5. **Test and deploy** — run tests, configure production settings
### Quick Start Example
```python
# models.py
from django.db import models
class Article(models.Model):
title = models.CharField(max_length=200)
body = models.TextField()
published_at = models.DateTimeField(auto_now_add=True)
class Meta:
ordering = ['-published_at']
def __str__(self):
return self.title
# views.py
from django.shortcuts import render, get_object_or_404
from .models import Article
def article_list(request):
articles = Article.objects.all()
return render(request, 'articles/list.html', {'articles': articles})
def article_detail(request, pk):
article = get_object_or_404(Article, pk=pk)
return render(request, 'articles/detail.html', {'article': article})
# urls.py
from django.urls import path
from . import views
urlpatterns = [
path('articles/', views.article_list, name='article-list'),
path('articles/<int:pk>/', views.article_detail, name='article-detail'),
]
```
```bash
# Setup workflow
django-admin startproject myproject
python manage.py startapp articles
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
```
### Django REST Framework Example
```python
# serializers.py
from rest_framework import serializers
from .models import Article
class ArticleSerializer(serializers.ModelSerializer):
class Meta:
model = Article
fields = ['id', 'title', 'body', 'published_at']
# views.py
from rest_framework import viewsets
from .models import Article
from .serializers import ArticleSerializer
class ArticleViewSet(viewsets.ModelViewSet):
queryset = Article.objects.all()
serializer_class = ArticleSerializer
```
## Best Practices
- One app per responsibility; normalize models and add database indexes
- Keep views thin — place business logic in services or model methods
- Always enable CSRF protection and configure security middleware
- Use `select_related` and `prefetch_related` to avoid N+1 queries
- Run tests with `python manage.py test`; use `--parallel` for speed
## Reference
- Official documentation: https://docs.djangoproject.com/
## Keywords
django, ORM, MTV, migrations, Python web, REST framework, admin, views, templates
More from partme-ai/full-stack-skills
- adobe-xd"Guides creation of UI/UX designs, interactive prototypes, reusable components, and design specs in Adobe XD. Use when the user asks about Adobe XD artboards, prototype links, repeat grids, component states, design tokens export, or developer handoff."
- angular"Provides comprehensive guidance for Angular framework including components, modules, services, dependency injection, routing, forms, and TypeScript integration. Use when the user asks about Angular, needs to create Angular applications, implement Angular components, or work with Angular features."
- ansible"Provides comprehensive guidance for Ansible automation including playbooks, roles, inventory, and module usage. Use when the user asks about Ansible, needs to automate IT tasks, create Ansible playbooks, or manage infrastructure with Ansible."
- ant-design-mini"Builds mini-program UIs with Ant Design Mini components for Alipay and WeChat mini-programs. Covers Button, Form, List, Modal, Tabs, NavBar, and 60+ components with theme customization and CSS variable theming. Use when the user needs to create mini-program interfaces with Ant Design Mini, configure themes, or implement mini-program-specific UI patterns."
- ant-design-mobile"Builds React mobile UIs with Ant Design Mobile (antd-mobile) components including Button, Form, List, Modal, Picker, Tabs, PullToRefresh, InfiniteScroll, and 50+ mobile-optimized components. Use when the user needs to create mobile-first React interfaces, implement mobile navigation, forms, or data display with Ant Design Mobile."
- ant-design-react"Builds enterprise React UIs with Ant Design (antd) including 60+ components (Button, Form, Table, Select, Modal, Message), design tokens, TypeScript support, and ConfigProvider theming. Use when the user needs to create React applications with Ant Design, build forms with validation, display data tables, or customize the Ant Design theme."
- ant-design-vueProvides comprehensive guidance for Ant Design Vue (AntDV) component library for Vue 3. Covers installation, usage, API reference, templates, and all component categories. Use when building enterprise-class UI with Vue 3 and Ant Design.
- api-doc-generator"Generate API documentation by scanning Controller classes, extracting endpoint URLs, HTTP methods, parameters, and response structures, then producing standardized docs from templates. Use when the user explicitly mentions generating API documentation, creating API docs, scanning interfaces, or documenting REST APIs. Do not trigger for generic documentation requests without explicit API mention."
- appium"Provides comprehensive guidance for Appium mobile testing including mobile app automation, element location, gestures, and cross-platform testing. Use when the user asks about Appium, needs to test mobile applications, automate mobile apps, or write Appium test scripts."
- ascii-ansi-colorizer"Add an ANSI color layer to existing ASCII/plain-text output (gradient/rainbow/highlights) with alignment-safe rules and a required no-color fallback. Use when the user wants to colorize terminal output, add rainbow effects to CLI text, or style ASCII art with ANSI colors."