-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
上传图片问题 #74
Comments
同问 |
同样的问题 |
from django.conf.urls import url, include urlpatterns = [ if settings.DEBUG:
|
这属于django的静态文件的问题了,图片上传之后上传框会回显图片的url 地址,可直接使用该地址用来显示图片。该地址就是你在settings 中配置的 其次,还要除以django debug 模式和生产模式对静态文件的区别。debug模式时,需要再url 里显示的添加 |
@KangKang-Wang 看下你console 下是否有如下报错,如有可增加 X_FRAME_OPTIONS 配置,该配置django3.0+下默认是deny和之前版本有区别。 |
文件也已经成功上传到目标文件夹内,可是前端拿不到该图片的url |
@KangKang-Wang 可否给我一个可复现上边错误的最小demo代码,我调试下。 |
demo.tar.gz |
没复现,你再别比对下。 |
在admin后台,添加图片时,点击本地上传,图片正确存入了相应的文件夹,请问此时图片地址应该填什么才可以使得图片正确显示呢?
The text was updated successfully, but these errors were encountered: