我想在django模板标签中连接字符串
{% extend shop/shop_name/base.html %}
Run Code Online (Sandbox Code Playgroud)
这里shop_name是我的变量,我想将其与路径的其余部分连接起来.
假设我有shop_name
我希望结果能够扩展 shop_name=example.com
我正在尝试连接一些字符串来格式化我的模板标签中的URL,但我找不到一种优雅的方式.
到目前为止,我所拥有的是:
{% button "Activate" "http://" site.domain url 'registration_activate' activation_key %}
Run Code Online (Sandbox Code Playgroud)
有没有最佳做法让它更具"可读性"?
非常感谢