Loading...
「ツール」は右上に移動しました。
利用したサーバー: wtserver2
300いいね 9076回再生

File Uploads - with Django REST Framework!

☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying me a coffee here:
ko-fi.com/bugbytes

⭐Top resource to learn Python - datacamp.pxf.io/kOjKkV

This video looks at how to setup file uploads with Django REST Framework. We cover Django FileFields, MEDIA settings, DRF Parsers, Views and Serializers, and finally how to upload the file to the DRF API using an AJAX request in JavaScript.

📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
00:00 Intro
00:48 Creating Django model with FileField
03:09 Adding Django MEDIA settings
03:35 Adding Django REST Framework serializer
05:06 Creating REST Framework API view for file upload
14:42 Changing content-type with REST Framework Parsers
18:50 Adding DRF read-only field to track upload date
22:34 Calling API with JavaScript AJAX request

𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:
📖 Blog: bugbytes.io/posts/
👾 Github: github.com/bugbytes-io/
🐦 Twitter: twitter.com/bugbytesio

📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:
Django REST Framework: www.django-rest-framework.org/
REST framework serializers: www.django-rest-framework.org/api-guide/serializer…
REST framework parsers: www.django-rest-framework.org/api-guide/parsers/
Classy DRF: www.cdrf.co/

#python #django #webdevelopment

コメント