Restarting servers in development

16 views
Skip to first unread message

Abhishek Choudhury

unread,
Oct 26, 2020, 12:51:58 PM10/26/20
to Django users
I have been working in Django from quite a long time, but every now and then I face the same issue. 
Why is it like whenever I change the CSS/ JS on the pages, it takes some time or restarting of servers to actually take effect. Can we improve this functionality? I am really passionate about Django. 

Akinfolarin Stephen

unread,
Oct 26, 2020, 12:57:30 PM10/26/20
to django...@googlegroups.com
The reason why it is so is because of the browser caching capabilities when the browser see that you are trying to visit a page you visited previously it will load it from the cache if you want it to display the current content press CTRL F5 and you will your newly added content

On Mon, Oct 26, 2020, 17:51 Abhishek Choudhury <choudhury...@gmail.com> wrote:
I have been working in Django from quite a long time, but every now and then I face the same issue. 
Why is it like whenever I change the CSS/ JS on the pages, it takes some time or restarting of servers to actually take effect. Can we improve this functionality? I am really passionate about Django. 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9ef394d2-651b-4e60-802a-715845a04572n%40googlegroups.com.

Abhishek Choudhury

unread,
Oct 26, 2020, 1:05:44 PM10/26/20
to django...@googlegroups.com
Thanks a lot for the information. Will definitely try. 



Thanks and Regards,
Abhishek Choudhury
Ph. no: +91 7903717967

Andréas Kühne

unread,
Oct 26, 2020, 1:23:15 PM10/26/20
to django...@googlegroups.com
If you are running in production, make sure that you use something like https://docs.djangoproject.com/en/3.1/ref/contrib/staticfiles/#manifeststaticfilesstorage for handling the css and js files. This will solve the problem automatically for you be adding a MD5 hash to the url of the file, which is updated every time you update the file.

Regards,

Andréas


Abhishek Choudhury

unread,
Oct 26, 2020, 1:26:45 PM10/26/20
to django...@googlegroups.com
That's exactly what I was looking for. Thanks for your help. 




Thanks and Regards,
Abhishek Choudhury
Ph. no: +91 7903717967
Reply all
Reply to author
Forward
0 new messages