Model Forms - Django File Upload Tutorial - Part 2

Опубликовано: 13 Ноябрь 2018
на канале: Vitor Freitas
85,500
1.3k

In this tutorial we are going to implement Model Forms to handle file upload using ImageField and FileField. As an example to illustrate this use case, we are going to create a Django model named "Book" with title, author, pdf, and cover image. Then, we are going to implement a data table to list the uploaded books and a Django form to upload new books.

👉 Part 3 - Class-Based Views:    • Class-Based Views - Django File Upload Tut...  
👉 Django File Upload Playlist:    • Introduction - Django File Upload Tutorial...  

-------------------------------------------------------------------------------

(0:22) ImageField and FileField definition
(1:30) Starting a CRUD example creating a Book model
(3:30) Migrating the Book model
(3:48) Adding the function based views to handle the upload and file listing
(6:24) [Actual example starts here] Creating the upload book form
(8:58) Handling the uploaded file inside a view function
(10:50) Listing the uploaded files
(12:36) Adding a download button to save the file
(14:12) Installing django-crispy-forms and using Bootstrap 4 styles on the forms
(15:21) Adding a ImageField to the Book model
(18:12) Displaying the uploaded image inside the table listing the books

-------------------------------------------------------------------------------

📎 Download the mindmap with references I used in the video: https://sibt.co/2OB5peg
✍🏻 Read the blog post: https://sibt.co/2OF6PUU
👨🏻‍💻 Project source code: https://github.com/sibtc/django-uploa...
✉️ Let's keep in touch! Subscribe to my mailing list: https://sibt.co/newsletter
🌎 For more on Django, Python and Web Development: https://simpleisbetterthancomplex.com

-------------------------------------------------------------------------------

🧔🏻 Follow me on:
https://github.com/vitorfs
  / vitorfs  
  / vitorfs  
  / vitorfs  

#django #python


На этой странице сайта вы можете посмотреть видео онлайн Model Forms - Django File Upload Tutorial - Part 2 длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Vitor Freitas 13 Ноябрь 2018, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 85,500 раз и оно понравилось 1.3 тысяч зрителям. Приятного просмотра!