4 ways to serve static files in Django

Поділитися
Вставка
  • Опубліковано 21 лип 2024
  • Django in development can serve its own static files. But when deployed in production, Django needs to rely on another method to serve its static content.
    In this video, we look at the 4 common ways to serve Django's static files.
    Those include the built-in development server, the whitenoise module, a web server like Nginx and S3 buckets.
    Chapters:
    ---------------
    0:00 intro
    0:15 development server
    3:18 whitenoise module
    4:56 Nginx
    5:47 S3 bucket
    7:52 outro

КОМЕНТАРІ • 33

  • @bharathkumargundala6466
    @bharathkumargundala6466 Місяць тому

    Thank you a thousand times. You saved me a lot of debug time.. I was struggling to debug and it turns out that gunicorn was not serving my static files by default

  • @underfakelights
    @underfakelights Рік тому +2

    Thank you for this, really helped me figure out why static files were not available after deployment. Best of luck with the channel, subscribed! :)

  • @elbersouza1490
    @elbersouza1490 3 місяці тому

    Thank you very very much!!! I was having a lot of problems in production and this video saved me!

  • @StudiofrogPl
    @StudiofrogPl 9 місяців тому +1

    excellent explanation, the best i found on youtube. You are great teacher, thanks.

  • @elbauldesantiago5842
    @elbauldesantiago5842 9 місяців тому

    Thank you for your content, I am from Venezuela and I am starting as a backend developer in django

  • @luisloyola3591
    @luisloyola3591 Рік тому +3

    wtf!! this channel is pure gold! thx for all

  • @robertzu43
    @robertzu43 Рік тому

    great video! really helpfull, had to change some things for my project, but keep it up.

  • @pv4tpuntosdeventa407
    @pv4tpuntosdeventa407 3 місяці тому

    I lost 3 days testing and modifiying settings. Here was the right configuration of whitenoise!! Thanks a lot!!

    • @davidrivera2546
      @davidrivera2546 Місяць тому +1

      you are talking about the deployment in render, righT? because i am fighting because my static resources are not showing.

  • @brisalastiri3819
    @brisalastiri3819 Рік тому +1

    very helpful video!

  • @superbin6021
    @superbin6021 9 місяців тому

    shit, I have spent more than one month just to figure out 1 way to handle static file in django.
    Thank you so much

  • @toDianeDev
    @toDianeDev Місяць тому

    Thank you for helping me remember how to configure collectstatic.

  • @ChopLancer
    @ChopLancer 14 днів тому

    I've used nginx, it's pretty convenient to do in containers and automatically have Django collect static into a volume shared with nginx, then reboot the nginx container and voila🎉

  • @SantiYounger
    @SantiYounger 2 місяці тому

    great video man, thanks

  • @0730pleomax
    @0730pleomax Рік тому +1

    Great content! Keep going :D

  • @Centerloglk
    @Centerloglk 6 місяців тому

    You're so good!

  • @arisntoulla108
    @arisntoulla108 Місяць тому

    Thank you

  • @marcosmadeira7895
    @marcosmadeira7895 9 місяців тому

    Perfect ❤

  • @caglargulucan
    @caglargulucan 10 місяців тому

    What should be done if the user does not detect any changes in a static file? For example, I make a change in main.js and the user does not see it. (AWS s3 bucket)

  • @FahadAhmed-ln7so
    @FahadAhmed-ln7so Рік тому

    what am I suppoed to add in Static url
    where can I find the AWS S3 CUSTOM Domain and s3 static dir

  • @aashayamballi
    @aashayamballi Рік тому

    Thanks!

  • @user-qj9mj2kk2d
    @user-qj9mj2kk2d 10 місяців тому

    Can i use whitenoice for media_url??? I have problem when i uploading image with imageField , image doesn't serve

  • @pravachanpatra4012
    @pravachanpatra4012 11 місяців тому

    should u run colelctic static before deployment will that work??

  • @Morimove
    @Morimove Рік тому

    which is better
    nginx or whitenoise for serving static files?🤔

  • @adeyemiowolabi6062
    @adeyemiowolabi6062 7 місяців тому

    I like your voice so I HIT the BELL!

  • @clearthinking5441
    @clearthinking5441 Рік тому

    Serving static files through NGINX, are they cached by default?

  • @kbnmaster123
    @kbnmaster123 9 місяців тому +2

    love the explanations, hate the keyboard sound

    • @drustan6890
      @drustan6890 6 місяців тому

      Yea that keyboard sound is annoying

  • @user-vb1mh8lj3n
    @user-vb1mh8lj3n Рік тому

    i love teacher :):):):):)

  • @soportesegumedik
    @soportesegumedik 7 місяців тому

    Teamooo

  • @user-ns5yp5dx5v
    @user-ns5yp5dx5v 24 дні тому

    Thank you