Understanding Django Static Files

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ก.พ. 2025

ความคิดเห็น • 80

  • @gazm2k5
    @gazm2k5 4 ปีที่แล้ว +4

    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!

  • @lightplan
    @lightplan 3 ปีที่แล้ว +1

    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.

  • @crispr6634
    @crispr6634 4 ปีที่แล้ว

    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!

  • @marcosolis9512
    @marcosolis9512 4 ปีที่แล้ว +1

    Very nice explanation, It is evident you have a really deep understanding of Django. Keep it up, pal.

    • @jaradpython4186
      @jaradpython4186  4 ปีที่แล้ว +3

      I learn it deeply, then forget it like a week later. That's why you gotta document your journey! Make it unique to you.

    • @marcosolis9512
      @marcosolis9512 4 ปีที่แล้ว

      @@jaradpython4186 Same thing happens to me, but I had never thought about that. What a great idea, I will start documentig everything!

  • @nielsSavantKing
    @nielsSavantKing 2 ปีที่แล้ว

    Very clear and at the point explanation. 100K hits. Come on!!

  • @felipedeabreuprazeres5690
    @felipedeabreuprazeres5690 3 ปีที่แล้ว

    This should be the GoTo link to all those stack overflow static files questions. A good, solid, explanation to the subject. 👍

  • @smamoden1523
    @smamoden1523 4 ปีที่แล้ว

    best static files explanation on the internet; thank you.

  • @suguruchhaya3194
    @suguruchhaya3194 4 ปีที่แล้ว

    Super easy to understand. #1 video on this topic.

  • @AunZaidi
    @AunZaidi 4 ปีที่แล้ว

    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. 👍🏼👏🏼

  • @Lalofike
    @Lalofike 4 ปีที่แล้ว +3

    Thank you man! It was really hard for me to understand this theme in django!

  • @relaxworking9756
    @relaxworking9756 2 ปีที่แล้ว

    Thank you sir, this is the best I've seen so far.

  • @zvonimirvlah9632
    @zvonimirvlah9632 4 ปีที่แล้ว +3

    Finally a great explanation, thanks bro !!

  • @absharif8146
    @absharif8146 4 ปีที่แล้ว

    Lot of confusion solved. Saved life. Love you.

  • @muralidhar40
    @muralidhar40 3 ปีที่แล้ว +1

    ABSOLUTELY FANTASTIC.

  • @venkataramireddy6689
    @venkataramireddy6689 4 ปีที่แล้ว

    Pretty nice explanation. Keep posting videos on django

  • @esrefhyd-amp1036
    @esrefhyd-amp1036 5 ปีที่แล้ว +1

    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

  • @yashmathur1389
    @yashmathur1389 3 ปีที่แล้ว +1

    Really great explanation

  • @tomaspyth7017
    @tomaspyth7017 4 ปีที่แล้ว

    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

  • @rockguy9113
    @rockguy9113 3 ปีที่แล้ว

    Thanks this really saved me after so much frustrations!!!

  • @jonathantana722
    @jonathantana722 4 ปีที่แล้ว

    Thanks very much for this tutorial is was extremely helpful to me. Deep content, and clear presentation. good job!

  • @IamRushikeshShinde
    @IamRushikeshShinde 4 ปีที่แล้ว

    Hey THANKS a lot man! It really fixed all the queries that i had, THANKS AGAIN

  • @jihadhammoud578
    @jihadhammoud578 2 ปีที่แล้ว

    GREAT EXPLANATION PLEASE MORE VIDEOS LIKE THISSSSSSSSSSSSSSSSSSSSSSSSSSSSS

  • @tobiass6584
    @tobiass6584 5 ปีที่แล้ว +2

    Great explanation! Thanks man!

  • @prateeksarangi9187
    @prateeksarangi9187 3 ปีที่แล้ว

    Thanks a lot Mate !! Learning in depth

  • @nhanNguyen-wo8fy
    @nhanNguyen-wo8fy 3 ปีที่แล้ว

    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

  • @khatriajaya
    @khatriajaya 2 ปีที่แล้ว

    Thank you for this video. This is very helpful!!

  • @hamdan_1242
    @hamdan_1242 7 หลายเดือนก่อน

    very detailed Video Brother....

  • @rajyalakshmid
    @rajyalakshmid 4 ปีที่แล้ว

    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?

  • @namesare4fools
    @namesare4fools 5 ปีที่แล้ว

    u save me there man.. best tutorial ever

  • @ysfy5106
    @ysfy5106 ปีที่แล้ว

    Really good explanation.

  • @Cubin4ik
    @Cubin4ik 4 ปีที่แล้ว

    Great explanation!

  • @akelius100
    @akelius100 5 ปีที่แล้ว

    Good job dude...Excellent explanation

  • @panagiotisgoulas8539
    @panagiotisgoulas8539 4 ปีที่แล้ว

    Thank you helped a lot, honestly docuntation was so bad at this topic.

  • @fabisierra7655
    @fabisierra7655 4 ปีที่แล้ว

    it´s the same for a three.js project?

  • @justalazyseo8285
    @justalazyseo8285 2 ปีที่แล้ว

    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.

  • @MagnusAnand
    @MagnusAnand 4 ปีที่แล้ว

    great video! Very clear and descriptive

  • @melaniecourtois3231
    @melaniecourtois3231 4 ปีที่แล้ว +2

    Great video! Thanks!!

  • @Foxygrandpa2131
    @Foxygrandpa2131 4 ปีที่แล้ว

    This is such a great explanation, thank you so much

  • @user-yw5jc1fi2l
    @user-yw5jc1fi2l 4 ปีที่แล้ว

    This video saved me! Thank you so much.

  • @dgiri2333
    @dgiri2333 3 ปีที่แล้ว

    Can you do one video for django and nginx

  • @mmi2805
    @mmi2805 4 ปีที่แล้ว

    Great explanation, thank you very much !!!

  • @drustan6890
    @drustan6890 4 ปีที่แล้ว

    can you do a video on media root for images?

  • @ekbergpeter6987
    @ekbergpeter6987 4 ปีที่แล้ว

    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?

  • @vadymnakonechnyi
    @vadymnakonechnyi 4 ปีที่แล้ว

    Bro, thank you so much for explanation!

  • @utkarshbajpai5035
    @utkarshbajpai5035 4 ปีที่แล้ว

    That was very helpful.

  • @mdobaidullahal-faruk3457
    @mdobaidullahal-faruk3457 5 ปีที่แล้ว +1

    It's really helpful. Thanks a lot.

  • @bigsneeks5714
    @bigsneeks5714 4 ปีที่แล้ว

    getting this error "ModuleNotFoundError: No module named 'puppies'"
    **sigh

  • @ellsonmendesYT
    @ellsonmendesYT 4 ปีที่แล้ว

    Now it is clear, thanks

  • @bruhhhhh718
    @bruhhhhh718 3 ปีที่แล้ว

    solid man, thank you

  • @Chespiritoish
    @Chespiritoish 4 ปีที่แล้ว

    Amazing you help me to solve my problem!!! :D

  • @jaecheokkim99
    @jaecheokkim99 4 ปีที่แล้ว

    Thank you so much for your great explanation! Thanks. really.

  • @ShaidaMuhammad
    @ShaidaMuhammad 3 ปีที่แล้ว

    Thanks man. It helped.

  • @HydoSkills
    @HydoSkills 2 ปีที่แล้ว

    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.

  • @priyamvashi2187
    @priyamvashi2187 4 ปีที่แล้ว

    Great video

  • @liviumircea6905
    @liviumircea6905 3 ปีที่แล้ว

    Excellent !

  • @chawza8402
    @chawza8402 4 ปีที่แล้ว

    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

  • @naheliegend5222
    @naheliegend5222 3 ปีที่แล้ว

    I still do not understand that STATIC_ROOT thing...

  • @numanali8545
    @numanali8545 3 ปีที่แล้ว

    Can't be better...omg...thx

  • @yoga_with_atharva
    @yoga_with_atharva 4 ปีที่แล้ว

    really helpful , thank you

  • @fanfarorro
    @fanfarorro 4 ปีที่แล้ว

    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)

    • @marcosolis9512
      @marcosolis9512 4 ปีที่แล้ว

      Is your DEBUF flag set to true in the settings file?

    • @fanfarorro
      @fanfarorro 4 ปีที่แล้ว

      @@marcosolis9512 yes

    • @marcosolis9512
      @marcosolis9512 4 ปีที่แล้ว +1

      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

    • @seanosuilleabhainemerald
      @seanosuilleabhainemerald 4 ปีที่แล้ว

      So helpful thank you.

  • @kumaranuj6548
    @kumaranuj6548 3 ปีที่แล้ว

    god bless you ! better explation then stackoverflow

  • @anonymouswanted3686
    @anonymouswanted3686 2 ปีที่แล้ว

    why is keanu reaves sitting here

  • @glassy5716
    @glassy5716 4 ปีที่แล้ว

    Thank you so much

  • @amannegi8256
    @amannegi8256 4 ปีที่แล้ว

    wowwww all clear

  • @shynggyskassen942
    @shynggyskassen942 4 ปีที่แล้ว

    Thank you so much!!!

  • @hammadyasir2174
    @hammadyasir2174 2 ปีที่แล้ว

    Thanks a lot.

  • @amirmasoud1192
    @amirmasoud1192 4 ปีที่แล้ว

    Thank you

  • @omarkelalech7187
    @omarkelalech7187 4 ปีที่แล้ว

    thank you

  • @mamamat223
    @mamamat223 4 ปีที่แล้ว

    thank you.

  • @4kids555
    @4kids555 ปีที่แล้ว

    thanks g

  • @mukeshvij2935
    @mukeshvij2935 4 ปีที่แล้ว

    I can't understand but thanks

  • @vijay1338
    @vijay1338 2 ปีที่แล้ว

    Thank you soo much