setting 里面: STATICFILES_DIRS = ( ('css', os.path.join(STATIC_ROOT, 'css')), ('js', os.path.join(STATIC_ROOT, 'js')), ('images', os.path.join(STATIC_ROOT, 'images')), )
html 页面里面引用了相关的 js 文件,但是 js 文件里面引用了图片: var carousels=[ {"url":"#","image":"images/b1.png","title":"xxx"}, {"url":"#","image":"images/b2.png","title":"xx"}, {"url":"#","image":"images/b3.png","title":"x"}, {"url":"#","image":"images/b1.png","title":"xxx"}, {"url":"#","image":"images/b2.png","title":"xx"}, {"url":"#","image":"images/b3.png","title":"x"} ] 服务器就不识别图片的地址,刚接触 Django 不太懂烦请指教
1
MekoPan OP 就是动态渲染 js 数据问题
|
2
superrichman 2019-11-16 10:58:20 +08:00
相对路径识别错了吧, 这地址还是拼个完整的路径比较好.
|