#Python #Shorts
If we're building a website that is used by millions of users across the globe, then we may want to store our static files, such as CSS or Javascript, in CDNs closest to our users to make sure their browsers can download these files fast.
Django helps us accomplish this by allowing us to create a "static" folder inside of our app and put all of our static files in there.
After we did that, we can use these files in our HTML files by using the {% load static %} option at the top of the HTML file, and then we can use something like {% static 'relative/path/to/static/folder/styles.css %} as a href on the link tag to let HTML know where to load the CSS file from.
-------------------------------------------------------------------------------------
📰 Sign up for my newsletter
Become a better dev in just 5 minutes (or so) a week: https://codevev.com
🖥️ Free Courses to Learn Programming
Harvard CS 50: https://pll.harvard.edu/course/cs50-i...
FreeCodeCamp: https://www.freecodecamp.org
Udacity: https://www.udacity.com
🛒 Products I recommend
https://codevev.com/#products
Connect with me
Website: https://codevev.com
Youtube: / @codevev
#codevev
Watch video How to Load Static Files in Django - Python Web Development online without registration, duration hours minute second in high quality. This video was added by user codevev 03 July 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 1,158 once and liked it 26 people.