In this tutorial, we will add the ability to add images to the database models for our Django Blog website application with Django and Python.
Get free access to my every month tips, tutorials, and resources, to improve your coding skills here: https://allcodejoker.pythonanywhere.com
We'll add an image field to our BlogPost database model.
We'll also pip install Pillow package to eventually save those images to the database.
#django #djangobeginners #djangotutorials #djangodjango #djangoproject #allcodejoker
All Code Joker GitHub: https://github.com/allcodejoker
Timecodes
0:00 - Introduction
0:35 - Add ImageField To BlogPost Database Model
2:10 - Pip Install Pillow Package
3:05 - Specify MEDIA_URL, MEDIA_ROOT And STATICFILES_DIRS variables in settings.py
4:50 - Append The Media Variables To Url_patterns In Urls.py
6:45 - Fix An Error
7:10 - Add An Image To Object Instance In The Database
8:35 - Set Image Field To Be Mandatory
9:30 - Conclusion