3

I'm facing some weird css issue with django . My css works fine but some how if i change any rule or add another one it does not take effect .

i'm using this to put css on django :

    (r'^/css/(?P<path>.*)$', 'django.views.static.serve',
{'document_root':'/home/lioy/django_projects/terrasis/css/'}),

and it is linked to my base.html :

< link rel="stylesheet" href="/css/style.css" type="text/css" />

It works . But somehow the changes that i made to my style.css doesnt take effect .I tried to change the background color of one already working propertie and nothing happend. Is that a bug or something .. ?

I restarted the django server and it doesnt make any difference ...

1 Answer 1

9

To speed up page loads your browser is likely using a cached copy of your CSS file; thinking that it hasn't changed since it was last fetched.

In that case you'll see something like this in the console:

[12/Feb/2011 20:50:35] "GET /site_media/css/style.css HTTP/1.1" 304 0

Where the 304 Not Modified status code means:

If the client has performed a conditional GET request and access is allowed, but the document has not been modified, the server SHOULD respond with this status code.

You can press ctrl+F5 to force a cache refresh (in Firefox anyway).
After that you should see that the browser fetches the CSS file again, e.g.:

[12/Feb/2011 22:05:02] "GET /site_media/css/style.css HTTP/1.1" 200 2242
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.