Restarting servers in development

瀏覽次數:16 次
跳到第一則未讀訊息

Abhishek Choudhury

未讀,
2020年10月26日 中午12:51:582020/10/26
收件者: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

未讀,
2020年10月26日 中午12:57:302020/10/26
收件者: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

未讀,
2020年10月26日 下午1:05:442020/10/26
收件者: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

未讀,
2020年10月26日 下午1:23:152020/10/26
收件者: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

未讀,
2020年10月26日 下午1:26:452020/10/26
收件者:django...@googlegroups.com
That's exactly what I was looking for. Thanks for your help. 




Thanks and Regards,
Abhishek Choudhury
Ph. no: +91 7903717967
回覆所有人
回覆作者
轉寄
0 則新訊息