新人初学!我在写django的模板页面时,html页面中想添加一个href,href分两个部分a和b,a是固定路径"http://aaa.com/",b是通过模板语言获取的{{ b.image }},这里{{ b.image }}取到的值为"image/b.png",最后想得到href=http://aaa.com/image/b.png。
怎么拼接呢?
href="http://aaa.com/{{ b.image }}"我是这样写的,生成后是这样的"http://aaa.com/%20image/b.png",多了一个”%20“