我试图上传一个用户生成的图像,然后显示在我的django网络应用。图像正在上载到服务器,但我无法显示它。你知道吗
image = models.ImageField(blank=True, null=True, max_length=255, upload_to="images/")
MEDIA_ROOT = '/home/user/webapps/static/'
MEDIA_URL = 'http://user.webfactional.com/static/'
例如,假设我上传了一个名为芬兰.gif. 我可以看到上传的文件。然而,当我看图片的来源时,我看到图片的来源是www.foo.com/accounts/profile/images/Finland.gif“而不是应该是的静态图像url”http://user.web派系.com/static/images/Finland.gif". 我该怎么解决这个问题有什么建议吗?你知道吗
刚刚解决了。。。我需要包括:
userprofile.image.url
提供图像的完整url相关问题 更多 >
编程相关推荐