python - 在django中打印href的值时需要删除url
问题描述
我正在尝试打印 href 值,但它与 url 一起出现
HTML
<style>
a.printable:link:after,
a.printable:visited:after {
content:" [" attr(href) "] ";
}
</style>
<table>
<tr>
<td height="40" valign="right" style="width:150px; font-size: 4.2mm; padding:4pt 0pt 0.5pt 0pt; text-align:center; background:#006400;"><a href="{{ request.scheme|safe|escape }}://{{ request.get_host }}/crm/orders/accepting/{{client.id}}/{{invoice.id}}/" class="printable" style="color:#fff; text-decoration:none;">Accept this Order</a></td>
</tr>
</table>
这里我真正需要的是
接受此订单
但我得到
接受此订单[http://127.0.0.1:8000/crm/orders/accepting/13/647/]
解决方案
推荐阅读
- android - 无法将活动范围内的对象注入 ViewModel
- reactjs - ReactJS:如何从 onClick 获取每张卡片的索引数组
- apache - 用于 profile.php 查询的 htaccess 重写器
- javascript - NextJS 构建偶尔会失败然后成功
- c# - 即使在 Outlook 中,如何附加到 BeforeAttachmentRead?
- amazon-web-services - 您是否需要在 AWS 上使用 Global Accelerator 的 NAT 网关和私有应用程序负载均衡器?
- java - 如何使用带有导航抽屉的片段?(爪哇)
- c# - 如何忽略 Regex.Match 上的特定字符
- buildkite - 是否可以为 buildkite 指定 .yml 文件的名称以用于其管道配置?
- python - 为什么 Python 将加法运算符的连续重复视为一次重复?