[ad_1]
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
32 responses to “Django Tutorial for Beginners – 25 – Bootstrap and Static Files”
I come from China,I really like this tutorials,but my English is very poor,too many point I can't understand…
bucky, i can't say this enough, but you are awesome!
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.
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..
Thank you so much, dude. Can you please to us how you got PyChram to autocomplete like that?
It is giving me this error, please help: Reverse for 'index' not found. 'index' is not a valid view function or pattern name.
how can I keep the menu with a white background? it stays with the same background that the body has.
Love your tutorials, thanks a lot!
@Bucky Roberts: You are the coolest Coder ever met!
If background image is not appearing, restart the server…
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
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
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!
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!
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.
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?
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?
In this line -> {% static 'music/style.css' %} it says unresolved template music. Can anyone pls help me with this?
i made the code for navigation bar …but there's no changes
where is the problem?
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…
How did you save the background images??????? I see nothing….
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 😀
The awkward moment, when you don't know how to use Bootstrap… :/
Hi, how can i use bootstrap autocomplete in PyCharm? Plz guide. 🙂
The css link is not working
Why my nav-header background is not white by default? Awesome tutorials btw!
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.
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..
Using the newest community edition, it doesn't come up with the stylesheet option shown @3:54. How should I fix this?
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.
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.
Here is the repo for the project: https://github.com/buckyroberts/Viberr