Restarting servers in development

16 visualizzazioni
Passa al primo messaggio da leggere

Abhishek Choudhury

da leggere,
26 ott 2020, 12:51:5826/10/20
a 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

da leggere,
26 ott 2020, 12:57:3026/10/20
a 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

da leggere,
26 ott 2020, 13:05:4426/10/20
a 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

da leggere,
26 ott 2020, 13:23:1526/10/20
a 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

da leggere,
26 ott 2020, 13:26:4526/10/20
a django...@googlegroups.com
That's exactly what I was looking for. Thanks for your help. 




Thanks and Regards,
Abhishek Choudhury
Ph. no: +91 7903717967
Rispondi a tutti
Rispondi all'autore
Inoltra
0 nuovi messaggi