Search code examples
pythondjangodjango-staticfiles

I deleted a css static file but my website still reads it?


I have a static css file called blog.css, and I load it in my base.html template like this:

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

But when I wanted to change something in that css, the changes doesn't appear. Due to my confusion, I tried to test some things.

  1. renaming blog.css to blog2.css

The weird part is, when I make changes to blog2.css, and called it in the base.html, my changes work, such as changing the background color, and etc.

but when I make changes to blog.css, nothing happens.

So, I tried to DELETE blog.css, but still called it in the base.html.

everything still works when I first made that file. I'm supposed to be expecting a broken designed HTML page and a 404 in the console because the blog.css in the static folder cannot be found.

It's like the blog.css is a ghost or something that is still here in my folder somewhere.. or am I missing something?

I also tried restarting the runserver command, refreshing the page countless times, and even restarting my computer.

I'm quite new to Django and I'm trying my best to understand it, and any help given is appreciated. Thank you very much!


Solution

  • I fixed it by clearing the cache in my browser. The blog.css from the cache is not found anymore.