1

I'm using Django Dev Server and trying to test some templates I've made. When I visit addresses, I can see from the server prompt that CSS and images are loaded, but when I'm looking in a browser it is not applied. I'm also using Bootstrap and strangely enough, it does get applied.

I would really like some help. I've seen (and implemented) the solution from various other threads with no avail. Please Help!

Threads I've seen:

Django -- Can't get static CSS files to load

CSS loaded but not applied

Django Static Files - CSS File Won't Load

Django CSS Attachment

Django - CSS problems

CSS loaded but empty

Tare Gaskin
  • 1,209
  • 2
  • 10
  • 13
  • in your browser open the source view of the page and click the links of your css. what you get? – Ankush Verma Jul 19 '17 at 17:40
  • It has the correct href, but it returns a Django Debug page saying stylesheet.css' not found. I think that the server does locate the file though, because before, when I didn't have the Django pointing to the right folder to look for my static files, it return a "Not Found" in the prompt. – Tare Gaskin Jul 20 '17 at 17:41
  • Okay, not sure what I did wrong but, I restructured the path of my where my static files are to look like myapp/static/myapp/stylesheet.css, and I got the CSS to load. It's a bit odd to me though that this solved it, because I had set the finder to look in the folder where I originally had my static files. It kinda scary how inflexible things seem to be. – Tare Gaskin Jul 20 '17 at 18:14
  • A follow up question: I am using both my own CSS and Bootstrap. My personal CSS seems to be being overwritten by Bootstrap CSS. How do I set the priority of how the CSS is used so that my CSS overwrites the Bootstrap? – Tare Gaskin Jul 20 '17 at 18:18
  • load your css after the bootstrap.css . It is because of the logic ` x = 3; x = 5;` this gives x = 5. you get this. – Ankush Verma Jul 20 '17 at 19:02

1 Answers1

2

Moving the CSS after bootstrap worked for me.

Like this

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" type="text/css" rel="stylesheet"> <link rel="stylesheet" type="text/css" href="{% static 'css/checkout.css' %}">

bchunggg
  • 21
  • 3