Django:页面不加载图像
我正在为一家公司开发 Django 项目。这个项目在今天之前运行得非常好。
今天我发现一个页面无法显示图像(及其对应的链接)。我检查了该页面的源代码,我发现有图像和链接,但我只是在页面上找不到它们。
我检查了服务器的身份验证,我确信我可以将内容写入数据库。事实上,我认为这不是数据库错误,因为我可以在页面源代码中找到我想要的东西,我只是在页面上找不到它们。
哦天哪,我要疯了...
有人遇到过类似的问题吗?这可能是什么问题?
请帮我!非常感谢!
PS:由于业务限制,我无法提供该项目的任何源代码...真的很抱歉...
I am working on a Django project for a company. This project worked very well before today.
Today I found a page can not show images (and their corrsponding links). I checked source code of THAT PAGE, I found there are images and links, I just can not find them on the page.
I checked the auth of the server and I am sure I can write things to the database. In fact, I think it is not database mistake because I can find what I want in the page source code, I just can not find them on the page.
Oh my Gosh, I am going to be crazy...
Has anyone suffered similar problem? What kind of problem could it be?
Please help me! Thank you very much!
PS: I can not provide any source code of the project because some business limit...I am really sorry...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试探索 site_media 目录。如果您的图像作为静态内容提供,则可能与本地磁盘上该文件夹的权限有关或基于设置。
在您的网址中,您可能有类似的内容:
或者它可能引用设置文件中的路径,类似的内容:
如果链接看起来对于图像是正确的,但即使直接侧面也没有渲染图像,您的问题将在这些中的某个地方地区。
有关更多信息,请查看 django 文档:
http://docs.djangoproject.com/en/dev/howto/static -文件/
Try exploring the site_media directory. If you're images are being served up as static content it could be related to the permissions of that folder on local disk or based on the settings.
Within your urls you may have something similar to:
OR it may reference the path in the settings file something similar to:
If the link looks correct for the image, but the side is not rendering the image even directly your issue will be somewhere in these areas.
For more information check the django docs:
http://docs.djangoproject.com/en/dev/howto/static-files/