Django Tutorial #8 - Static Assets

Sdílet
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/

Komentáře • 7

  • @Angelas20
    @Angelas20 Před měsícem +3

    @19:06 javascript console.log will go to client or browser console. Not in server console. I like your contents, and following you

  • @fernandarodrigues6522
    @fernandarodrigues6522 Před 12 dny +1

    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?

  • @user-kb4ny7mx6n
    @user-kb4ny7mx6n Před měsícem

    Please make a playlist on how to make 3D websites using React Three js and GSAP

  • @artiphoria
    @artiphoria Před měsícem

    @11:24 You mean "included in the APP" not in the "project"

  • @Angelas20
    @Angelas20 Před měsícem

    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?

    • @artiphoria
      @artiphoria Před měsícem +1

      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.

  • @SamuelSibarani-nf9vx
    @SamuelSibarani-nf9vx Před 2 dny

    why you always change the directory file, i' m confused to follow what i have to follow