Skip to content

Instantly share code, notes, and snippets.

View ruslan-korneev's full-sized avatar
🦆
Typing ...

Ruslan Korneev ruslan-korneev

🦆
Typing ...
View GitHub Profile
@ruslan-korneev
ruslan-korneev / tonconnect-manifest.json
Created October 27, 2025 21:57
TonConnect manifest for ruslan.beer
{
"url": "https://ruslan.beer",
"name": "ruslan.beer",
"iconUrl": "https://ruslan.beer/favicon.png",
"termsOfUseUrl": "https://ruslan.beer",
"privacyPolicyUrl": "https://ruslan.beer"
}

Serializer and Permission per action in Django REST Framework

In Django REST Framework you have a Viewsets, which can contain multiple views (actions). But to use different serializers and permissions for each action you always need to override get_serializer_class or get_permissions methods. Here I've implemented a mixins which allow you to setup your serializers and permissions per action in a dictionaries

Usage Example

class UserViewSet(SerializerPerAction, PermissionPerAction, ModelViewSet):
    queryset = User.objects.all()
    action_serializers = {