소스 정보
- 저장소
- javimosch/open-claw-skills
- 최근 소스 활동
- 2026년 6월 6일 19:20
- 감지된 SKILL.md 언어
- 영어
- 스타
- 0
- 포크
- 1
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/javimosch/open-claw-skills --skill drf명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | drf |
| description | Django REST Framework scaffolding best practices, and gotchas. |
| homepage | https://github.com/pradeepcep/openclaw-drf |
| metadata | {"clawdbot":{"emoji":"🔥","requires":{"bins":"[Truncated]"},"os":["linux","darwin","win32"]}} |
This skill details how to generate, configure, and enhance REST APIs using Django + Django REST Framework (DRF). It includes instructions on project setup, API structure, serializers, viewsets, routing, authentication, performance optimization, testing, and common pitfalls.
Use this skill when you:
djangorestframework in its requirements.txt or pyproject.tomlpython3 -m venv .venv
source .venv/bin/activate
pip install django djangorestframework
django-admin startproject project .
python manage.py startapp [appname or "api"]
Add to settings.py:
INSTALLED_APPS = [
"rest_framework",
appname or "api",
]
REST_FRAMEWORK = {
"DEFAULT_PERMISSION_CLASSES": [
"rest_framework.permissions.IsAuthenticated",
],
"DEFAULT_RENDERER_CLASSES": [
"rest_framework.renderers.JSONRenderer",
],
"DEFAULT_FILTER_BACKENDS": [
"django_filters.rest_framework.DjangoFilterBackend",
],
"DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.LimitOffsetPagination",
"PAGE_SIZE": 10,
}
ModelSerializer to reduce boilerplate.serializers.py file inside the appropriate Django appExample:
# File: accounts/serializers.py
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = ["id", "username", "email"]
ViewSet or ModelViewSet for standard CRUD APIs.get_queryset() instead of filtering in the serializer.views.py file inside the appropriate Django appExample:
# File: accounts/views.py
class UserViewSet(ModelViewSet):
serializer_class = UserSerializer
def get_queryset(self):
return User.objects.filter(is_active=True)
urls.py file inside the appropriate Django appurls.py inside the Django app is included in the main urls.pyExample:
# File: accounts/urls.py
router = DefaultRouter()
router.register("users", UserViewSet)
urlpatterns = router.urls
Example:
# File: project/urls.py
urlpatterns = [
path("", include("accounts.urls")),
]
IsAuthenticated) rather than open.permissions.py file inside the appropriate Django app.Example:
permission_classes = [IsAuthenticated]
get_queryset() using request parameters.Protect APIs from abuse:
REST_FRAMEWORK = {
"DEFAULT_THROTTLE_CLASSES": [
"rest_framework.throttling.AnonRateThrottle",
"rest_framework.throttling.UserRateThrottle",
],
"DEFAULT_THROTTLE_RATES": {
"anon": "100/day",
"user": "1000/day",
},
}
select_related() for foreign keys.prefetch_related() for many-to-many and reverse relations.Example:
# File: orders/views.py
def get_queryset(self):
return Order.objects.select_related("customer").prefetch_related("items")
APITestCase and APIClient.Avoid putting business logic inside: - serializers - views - permission classes
Instead, use: - service modules - domain logic in models - reusable helper functions
DRF does not optimize queries automatically. Missing
select_related() or prefetch_related() will silently destroy
performance.
Common mistakes: - Forgetting permission classes - Allowing unauthenticated access by default - Exposing writeable fields unintentionally - Exposing passwords or secret fields in response
Always audit:
- serializer fields
- permission classes
- allowed HTTP methods
Django REST Framework is primarily synchronous.
Do not assume: - async views improve performance automatically - background tasks belong in request/response cycles
Use task queues (Celery etc.) for long-running work.
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver