That was solid. I've done a couple of django tutorials and they explain how to use static files but not how it's all working under the hood, so when stuff goes wrong it's really hard to fix. This explanation gave me a much better understanding. Thanks!
Thank you very much! I've noticed that this is the only tutorial that properly explains how Static files work in Django. Most tutorials seem to ignore some of the basic concepts.
This is the best django related tutorial I've come across. Instead of just showing how to use a feature, you go into how the feature actually works. Great content!
I see you don't post videos anymore but brother I found this very useful. I am new developer and new to Django and being explained one concept in such detail was genuinely helpful. Thank you and you did a great job. 👍🏼👏🏼
Hi bro,I am using Google chats ,when calling chats JavaScript , script it's return fine, JavaScript depending other scripts are losing path from after url pattern ,how to resolve
thanks a lot for sharing your knowledge. bevor i saw your video i really couldn't figure out how this static thing work since i am new to django and i don't even know how to use the documentation effectively (looks overloaded for me). so thanks again. great work thumbs up
Thank you for the detailed explanation. I am having an issue with static files serving in my server. I am able to run to serve static files all the css working as expected . But the same code whihch deployed using the docker is not serving the static files. all the files available in server.ANy clue?
This was great! Would love to see even more in-depth material about this! I found an easy way to test if staticfiles work or not: Install gunicorn and run gunicorn yourapp.wsgi. If the static files are not collected and configured correctly, they will not show. Benefit of this is that gunicorn can't deal with djangos dev env static.
Thanks for the video. One question. After you changed the root and ran the command for collecting static files, is it possible to change it again? If so, how? And is it possible on a server to have a directory outside the base so it's not accessible by browsing to that image? Will they still be available for my templates?
Okay so for every one reading this searching the same thing I do which is not the stuff this guys explaining. You want to make urls inside css file static. Yes that's what I want too. For example linking css files with @import: url([static path]); .. I'm sorry to inform you there's no easy fix without a compressor. And next to the compressor you need to use sass django-libsass. Then setup the compressor as shown in GitHub, then setup the libsass also shown in GitHub. I know this is a terrible way of serving css and other linking scripts since there's no real none static way of doing it but this is the only way to achieve it. In a complex design this might require you to edit hundreds if not thousands of lines of code to make it work. Therefor I ditched django... again for the same reason i did a couple of years back, this system of serving static files is the weakest part of the framework. So if you have a complex design where you need the use of urls in static css files: yes there is a way, no your not gonna like it.
I have read the documentation numerous times but still don't understand how Django handles static files funny thing what you did is walkthrough the same doc and yet it is clearer
My django is crazy. STATIC_URL = 'assets' then in folder /APP/static/APP/img/img.jpg etc. the path to img in html: assets/app/img/img.jpg why is this working x)
I just realized you dont have a leading and trailing "/" in your STATIC_URL. It should be like this: "/assets/" The docs explicitly say the slash is needed: docs.djangoproject.com/en/3.0/ref/settings/#static-url
That was solid. I've done a couple of django tutorials and they explain how to use static files but not how it's all working under the hood, so when stuff goes wrong it's really hard to fix. This explanation gave me a much better understanding. Thanks!
Thank you very much! I've noticed that this is the only tutorial that properly explains how Static files work in Django. Most tutorials seem to ignore some of the basic concepts.
This is the best django related tutorial I've come across. Instead of just showing how to use a feature, you go into how the feature actually works. Great content!
Very nice explanation, It is evident you have a really deep understanding of Django. Keep it up, pal.
I learn it deeply, then forget it like a week later. That's why you gotta document your journey! Make it unique to you.
@@jaradpython4186 Same thing happens to me, but I had never thought about that. What a great idea, I will start documentig everything!
Very clear and at the point explanation. 100K hits. Come on!!
This should be the GoTo link to all those stack overflow static files questions. A good, solid, explanation to the subject. 👍
best static files explanation on the internet; thank you.
Super easy to understand. #1 video on this topic.
I see you don't post videos anymore but brother I found this very useful. I am new developer and new to Django and being explained one concept in such detail was genuinely helpful. Thank you and you did a great job. 👍🏼👏🏼
Thank you man! It was really hard for me to understand this theme in django!
Thank you sir, this is the best I've seen so far.
Finally a great explanation, thanks bro !!
Lot of confusion solved. Saved life. Love you.
ABSOLUTELY FANTASTIC.
Pretty nice explanation. Keep posting videos on django
Hi bro,I am using Google chats ,when calling chats JavaScript , script it's return fine, JavaScript depending other scripts are losing path from after url pattern ,how to resolve
Really great explanation
thanks a lot for sharing your knowledge. bevor i saw your video i really couldn't figure out how this static thing work since i am new to django and i don't even know how to use the documentation effectively (looks overloaded for me). so thanks again. great work thumbs up
Thanks this really saved me after so much frustrations!!!
Thanks very much for this tutorial is was extremely helpful to me. Deep content, and clear presentation. good job!
Hey THANKS a lot man! It really fixed all the queries that i had, THANKS AGAIN
GREAT EXPLANATION PLEASE MORE VIDEOS LIKE THISSSSSSSSSSSSSSSSSSSSSSSSSSSSS
Great explanation! Thanks man!
Thanks a lot Mate !! Learning in depth
4:55 giải thích static_url
6:40 -- 14:20 giải thích staticfiles_dirs trong setting
15:40 explain static_root
22:30
Thank you for this video. This is very helpful!!
very detailed Video Brother....
Thank you for the detailed explanation. I am having an issue with static files serving in my server. I am able to run to serve static files all the css working as expected . But the same code whihch deployed using the docker is not serving the static files. all the files available in server.ANy clue?
u save me there man.. best tutorial ever
Really good explanation.
Great explanation!
Good job dude...Excellent explanation
Thank you helped a lot, honestly docuntation was so bad at this topic.
it´s the same for a three.js project?
This was great! Would love to see even more in-depth material about this!
I found an easy way to test if staticfiles work or not: Install gunicorn and run gunicorn yourapp.wsgi. If the static files are not collected and configured correctly, they will not show. Benefit of this is that gunicorn can't deal with djangos dev env static.
great video! Very clear and descriptive
Great video! Thanks!!
You bet!
This is such a great explanation, thank you so much
This video saved me! Thank you so much.
Can you do one video for django and nginx
Great explanation, thank you very much !!!
can you do a video on media root for images?
Thanks for the video. One question. After you changed the root and ran the command for collecting static files, is it possible to change it again? If so, how? And is it possible on a server to have a directory outside the base so it's not accessible by browsing to that image? Will they still be available for my templates?
Bro, thank you so much for explanation!
That was very helpful.
It's really helpful. Thanks a lot.
getting this error "ModuleNotFoundError: No module named 'puppies'"
**sigh
Now it is clear, thanks
solid man, thank you
Amazing you help me to solve my problem!!! :D
Thank you so much for your great explanation! Thanks. really.
Thanks man. It helped.
Okay so for every one reading this searching the same thing I do which is not the stuff this guys explaining. You want to make urls inside css file static. Yes that's what I want too. For example linking css files with @import: url([static path]); .. I'm sorry to inform you there's no easy fix without a compressor. And next to the compressor you need to use sass django-libsass. Then setup the compressor as shown in GitHub, then setup the libsass also shown in GitHub. I know this is a terrible way of serving css and other linking scripts since there's no real none static way of doing it but this is the only way to achieve it. In a complex design this might require you to edit hundreds if not thousands of lines of code to make it work. Therefor I ditched django... again for the same reason i did a couple of years back, this system of serving static files is the weakest part of the framework. So if you have a complex design where you need the use of urls in static css files: yes there is a way, no your not gonna like it.
Great video
Excellent !
I have read the documentation numerous times but still don't understand how Django handles static files
funny thing what you did is walkthrough the same doc and yet it is clearer
I still do not understand that STATIC_ROOT thing...
Can't be better...omg...thx
really helpful , thank you
My django is crazy. STATIC_URL = 'assets'
then in folder /APP/static/APP/img/img.jpg etc.
the path to img in html: assets/app/img/img.jpg
why is this working x)
Is your DEBUF flag set to true in the settings file?
@@marcosolis9512 yes
I just realized you dont have a leading and trailing "/" in your STATIC_URL. It should be like this: "/assets/"
The docs explicitly say the slash is needed:
docs.djangoproject.com/en/3.0/ref/settings/#static-url
So helpful thank you.
god bless you ! better explation then stackoverflow
why is keanu reaves sitting here
Thank you so much
wowwww all clear
Thank you so much!!!
Thanks a lot.
Thank you
thank you
thank you.
thanks g
I can't understand but thanks
Thank you soo much