pombreda / django-hotclub

Automatically exported from code.google.com/p/django-hotclub
MIT License
0 stars 0 forks source link

Css changes not updated on a live site without refresh #194

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Visit your site in a browser
2. Change the css file
3. Go to your site again (type it in again, don't hit refresh)

What is the expected output? What do you see instead?
You would expect the site to reflect your css changes, but it doesn't due
to browser caching. For some reason, browsers just assume the css file
won't change.

What version of the product are you using? On what operating system?
- doesn't matter

Please provide any additional information below.

The best way to fix this is to change your template to include the
svn-version as a GET argument where ever you have the code to add the css
file like so...

1. add {% load svn_app_version %} to your template
2. Change your link tag from
<link rel="stylesheet" href="{{ MEDIA_URL }}base.css" />

to
<link rel="stylesheet" href="{{ MEDIA_URL }}base.css?{% svn_app_version %}" />

In the default pinax project it had a static number as the get argument,
but I think that using the svn version is a better solution because it will
automatically change when you change the code of the site.

I guess in a perfect world you could use the svn version of the css file
itself, but this solution seems good enough to me :)

Original issue reported on code.google.com by Jim.mixt...@gmail.com on 5 Mar 2009 at 3:42

GoogleCodeExporter commented 9 years ago

Original comment by jtau...@gmail.com on 16 Mar 2009 at 3:08