HTML и формы
Рендеринг HTML
from my_project.example.models import Profile
from rest_framework.renderers import TemplateHTMLRenderer
from rest_framework.response import Response
from rest_framework.views import APIView
class ProfileList(APIView):
renderer_classes = [TemplateHTMLRenderer]
template_name = 'profile_list.html'
def get(self, request):
queryset = Profile.objects.all()
return Response({'profiles': queryset})Рендеринг форм
Использование пакетов шаблонов
rest_framework/vertical.
rest_framework/vertical.
rest_framework/horizontal.
rest_framework/horizontal.
rest_framework/inline.
rest_framework/inline.
Стили полей
base_template
Правильные типы полей
Дополнительные параметры стиля
Last updated
Was this helpful?