0

I'm working on a project in Django and I'm trying to clean some of the CSS up. The project is called 'rs'. The path to the stylesheet in the project folder is :

rsinterface/static/rsinterface/style.css

At the top of my file, I include static files using {% load staticfiles %}.

I then link the stylesheet using the line:

<link rel="stylesheet" type="text/css" href="{% static 'rsinterface/style.css' %}" />

I made some changes to the stylesheet that should be immediately visible, saved and closed the stylesheet, reloaded the page, and nothing was changed. There was some stylesheet that was loaded, as all the previously existing styling stayed the same, but the edits I made were not reflected. I didn't revert any changes, and roughly an hour later I reloaded the page again and the changes were there. I then changed the stylesheet again and, once again, the page didn't change. Ever since then its been intermittent in actually changing the page.

The one way I found to always make the style changes go through is by modifying the CSS file's name each time, but this leads to issues with version control software. Is there an explanation for this phenomenon, and is there any other workaround to make sure it doesn't continue to occur?

1
  • 1
    Are you running with DEBUG = True? If not, then you'll need to execute python manage.py collectstatic. It might also be worth posting the relevant static properties in your settings.py file. Commented Feb 21, 2017 at 20:57

2 Answers 2

2

Try updating your browser and delete the data after saving your CSS.

For example, in Chrome, use Ctrl + F5 (Windows/LInux) or Cmd + Shift + R (Mac)

Sign up to request clarification or add additional context in comments.

Comments

0

Because your website is still using a cached version of your CSS. you can easily see this in your chrome debugger under network tab. enter image description here

just open in a different browser or clear cache memory in your browser.

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.