0

I added a new class in the custom CSS file in a Django app and changed the HTML accordingly.

The problem is that the class is getting applied to let's say a button but the page is not showing the changes.

For example:

Please check the below snippet

<button type="button" class="btn btn-primary btn-lg">Text</button>

I added a new class .btn-custom in custom.css and changed the HTML file as well.

Now after the refresh, the above tag changed to

<button type="button" class="btn btn-custom btn-lg">Text</button>

But the style is not applied to the page.

I check the custom CSS file by opening the source and the changes I made are there.

After 2 to 3 hrs the changes getting reflected. I tried hard refresh as well cache clearing and every other option related to cache

Lajos Arpad
  • 64,414
  • 37
  • 100
  • 175
muneer
  • 17
  • 4

1 Answers1

1

The behavior consists of your HTML being successfully changed but your CSS not changed. This indicates the presence of a cache. It can be either the browser cache or server-cache.

I see that you have ruled out caching issues, but from your description it seems that you have ruled out browser cache issues. However, Django has a cache mechanism on its own, which caches static files. And the cache of static files can be turned off.

Lajos Arpad
  • 64,414
  • 37
  • 100
  • 175