简体   繁体   English

Static 文件托管,WhiteNoise 不更新 - Django

[英]Static File Hosting, WhiteNoise not Updating - Django

I have a Django website in production and a while back I successfully hosted my static files using Whitenoise so I could use them in production.我有一个 Django 网站正在生产中,前一段时间我使用 Whitenoise 成功托管了我的 static 文件,因此我可以在生产中使用它们。 Now a few months later I want to add a new.png along with a bunch of other code and push it to production.现在几个月后,我想添加一个 new.png 以及一堆其他代码并将其推送到生产环境。 I added the.png I wanted into my static files then deleted my 'staticfiles' folder in my code and reran python manage.py collectstatic .我将我想要的 .png 添加到我的 static 文件中,然后删除了代码中的“staticfiles”文件夹并重新运行python manage.py collectstatic The files all collected like normal but when I ran my local server the page is no longer hosting that new.png using whitenoise.这些文件都像往常一样收集,但是当我运行我的本地服务器时,页面不再使用 whitenoise 托管 new.png。 All the other static files that were hosting successfully before are STILL hosting fine now and being hosted by whitenoise.之前成功托管的所有其他 static 文件现在仍然可以正常托管并由 whitenoise 托管。 Its just the new one that is not being hosted through whitenoise.它只是一个新的,不是通过 whitenoise 托管的。 I checked the 'static files' folder and the new.png is in there fine with a copy of itself and additional characters added to its name like whitenoise usually does and like how all the other files are that are being successfully hosted.我检查了“静态文件”文件夹,new.png 在那里很好,有它自己的副本和添加到它的名称的其他字符,就像 whitenoise 通常所做的那样,就像所有其他文件被成功托管的方式一样。

How do I update/refresh Whitenoise to acknowledge a new static file added?我如何更新/刷新 Whitenoise 以确认添加了新的 static 文件?

Thanks!谢谢!

I figured it out.我想到了。 I had the file named ".PNG" and it needed to be ".png".我有一个名为“.PNG”的文件,它需要是“.png”。 Small mistake but I finally tracked it down.小错误,但我终于找到了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM