Django Tutorial #8 - Static Assets
Vložit
- čas přidán 18. 06. 2024
- In this Django tutorial series, you'll learn what Django is, how to setup a Django project, and how to use it to make a full web application, complete with a database and authentication.
🚀🥷🏼 Check out Bek Brace's channel for more of his content:
/ @bekbrace
🔥🥷🏼Get access to premium courses on Net Ninja Pro:
netninja.dev/
📂🥷🏼 Access the course files on GitHub:
github.com/BekBrace/django_co...
🧠🥷🏼 HTML Crash Course
• HTML & CSS Crash Cours...
🧠🥷🏼 Python Crash Course
• Python Crash Course #1...
🔗🥷🏼 Django docs:
docs.djangoproject.com/en/5.0/
@19:06 javascript console.log will go to client or browser console. Not in server console. I like your contents, and following you
My alert is not popping up when the page loads. I tested with Inline JavaScript, temporarily added the script directly in the HTML file and it works correctly, but like showed in the class it doesn't work. Any clue why it is happening?
Please make a playlist on how to make 3D websites using React Three js and GSAP
@11:24 You mean "included in the APP" not in the "project"
One confusion, according to settings STATICFILES_DIR tuple contains one entry BASEDIR + 'static' folder. So django will look for static conents in BASEDIR + static folder. But why django will look for also in other app folder? Though app folder is not mentioned in the tuple, right?
Well, here's how Django behaves regarding the 'static' files:
First, it looks for the static files in the App. If not found, then
Second, it will look for the 'static' files in the project (this is the meaning of BASEDIR + static folder ), if not found,
Third, it will look for 'static' files in other Apps, if not found
Finally, it will raise an exception error.
In case we write this line
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static')
]
It's a good strategy to create a 'static' folder in the PROJECT folder .
Hope this helps.
why you always change the directory file, i' m confused to follow what i have to follow