• Wednesday , 13 December 2017

Django Tutorial for Beginners – 25 – Bootstrap and Static Files

Code Canyon
https://i.ytimg.com/vi/Dv15y5CgCyE/hqdefault.jpg



Facebook – https://www.facebook.com/TheNewBoston-464114846956315/
GitHub – https://github.com/buckyroberts
Google+ – https://plus.google.com/+BuckyRoberts
LinkedIn – https://www.linkedin.com/in/buckyroberts
reddit – https://www.reddit.com/r/thenewboston/
Support – https://www.patreon.com/thenewboston
thenewboston – https://thenewboston.com/
Twitter – https://twitter.com/bucky_roberts

Original source

3d Ocean

Related Posts

32 Comments

  1. 姜志福
    September 2, 2017 at 21:09

    I come from China,I really like this tutorials,but my English is very poor,too many point I can't understand…

  2. Alex Yap
    September 2, 2017 at 21:09

    bucky, i can't say this enough, but you are awesome!

  3. Kojak Eugenio
    September 2, 2017 at 21:09

    For those who are having issue with the background.png not showing up. Make sure the background.png file is not corrupted. I downloaded it from bucky's repo and it looks corrupted that's why it isnt showing the the page. I download different image with the same background.png and it worked.

  4. askmiller
    September 2, 2017 at 21:09

    I love how you're like: I made this repo for the project a few steps ahead of where we're at now. /shows nearly complete project that looks nothing like what we got now..

  5. HYPED247
    September 2, 2017 at 21:09

    Thank you so much, dude. Can you please to us how you got PyChram to autocomplete like that?

  6. Preksha singh
    September 2, 2017 at 21:09

    It is giving me this error, please help: Reverse for 'index' not found. 'index' is not a valid view function or pattern name.

  7. Carlos Manuel Sisnett Perdomo
    September 2, 2017 at 21:09

    how can I keep the menu with a white background? it stays with the same background that the body has.

  8. Yurii Horwight
    September 2, 2017 at 21:09

    Love your tutorials, thanks a lot!

  9. ImmoFound
    September 2, 2017 at 21:09

    @Bucky Roberts: You are the coolest Coder ever met!

  10. Akshay Dixit
    September 2, 2017 at 21:09

    If background image is not appearing, restart the server…

  11. Thomas Perkov
    September 2, 2017 at 21:09

    If you don't see the navbar (like me), simply copy paste a new Bootstrap CDN from this site: http://getbootstrap.com/getting-started/#download

  12. Jalen Jackson
    September 2, 2017 at 21:09

    For some reason if you run the server on pycharm none of the css files are loaded in, but if you run the server in the command prompt it works

  13. Jason
    September 2, 2017 at 21:09

    The CSS Background wasn't changing for me and I must have spent 40 minutes looking for the problem, restarting my server etc. My style.css folder was in the images directory instead of the music directory. I feel like an idiot!

  14. Thames Khi
    September 2, 2017 at 21:09

    Interesting method: I believe from the Django website and maybe some other source it states that you should add the following line to the settings.py file:

    STATIC_ROOT = os.path.join(BASE_DIR, 'static/')

    Then you can reference the source as follows:

    index.html
    <link rel="stylesheet" type="text/css" href="/static/music/style.css">

    style.css

    background: white url("/static/music/images/background.png");

    It's just a question which is better? I will stick to your method unless told otherwise!

  15. Thames Khi
    September 2, 2017 at 21:09

    Dude I wish I discovered your fantastic tutorials last year. I was watching another one and to be honest, he is good but this is the best for DJango.

  16. Al Adolfsen
    September 2, 2017 at 21:09

    Hey Bucky,  how come your font changed?  It doesn't on mine.    And, is the bootstrap autocomplete a result of you using the paid for version of PyCharm instead of the community edition?

  17. Ray Daniel
    September 2, 2017 at 21:09

    What is the accepted way of laying out a django project with many apps? For example, I have a main site with sidebar navigation containing links to the apps within my project. Should I create subapps or should I create a main app that manages the link navigation? I ask at this point in your tutorials because I would rather have a master layout page for my static includes much the way an Asp.Net MVC app works. Perhaps this is touched on in another lesson?

  18. Parag Kadam
    September 2, 2017 at 21:09

    In this line -> {% static 'music/style.css' %} it says unresolved template music. Can anyone pls help me with this?

  19. Heba ElBhnasawy
    September 2, 2017 at 21:09

    i made the code for navigation bar …but there's no changes
    where is the problem?

  20. Drashya Kushwah
    September 2, 2017 at 21:09

    I am using Pycharm community edition so in this css option is not available.
    Now how can I add css file in my project.??
    Plz help…

  21. LI WEIJIE
    September 2, 2017 at 21:09

    How did you save the background images??????? I see nothing….

  22. RawrBear Media
    September 2, 2017 at 21:09

    To anyone having issues with the css link not working.. Reload the server. I've been trying all kinds of hacks and tricks to make it work, in the end, a server reboot fixed it 😀

  23. Maxos Balkaniwtis
    September 2, 2017 at 21:09

    The awkward moment, when you don't know how to use Bootstrap… :/

  24. Galaxy splus
    September 2, 2017 at 21:09

    Hi, how can i use bootstrap autocomplete in PyCharm? Plz guide. 🙂

  25. solomon solo
    September 2, 2017 at 21:09

    The css link is not working

  26. Almaral Engineering
    September 2, 2017 at 21:09

    Why my nav-header background is not white by default? Awesome tutorials btw!

  27. Naman Maheshwari
    September 2, 2017 at 21:09

    Hi. What plugin do you use for the bootstrap autocomplete in PyCharm? I tried using the Bootstrap plugin for live templates, but there is no autocomplete.

  28. space_punkin
    September 2, 2017 at 21:09

    is there a way to make a style sheet in pycharm community edition?
    i found that its only in professional edition, but wanted to ask anyway..

  29. kelkka7
    September 2, 2017 at 21:09

    Using the newest community edition, it doesn't come up with the stylesheet option shown @3:54. How should I fix this?

  30. Wenneguen
    September 2, 2017 at 21:09

    I checked and re-watched the video at least five times, but for me the background does not change, the css file does not seem to be working… Any idea ? Thanks.

  31. Nitrax M
    September 2, 2017 at 21:09

    Quick question, if the site is going to grow to a full produciton – wouldnt it be better to use Django's staticfiles app?
    As in having a static folder i the root of the project, and using manage.py collectstatic to copy all the contents into this one folder defined as STATIC_ROOT in the settings.py

    https://docs.djangoproject.com/en/1.9/ref/contrib/staticfiles/

    EDIT: My bad, seems like this is the way to do it, and rather use the collectstatic later on when publishing the project. So development should be done just as you've shown.

  32. Bucky Roberts
    September 2, 2017 at 21:09

    Here is the repo for the project: https://github.com/buckyroberts/Viberr

Leave A Comment

You must be logged in to post a comment.