Jinja中的Base64解码字符串 [英] Base64 Decode String in jinja

查看:167
本文介绍了Jinja中的Base64解码字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是使用python和flask的新手,真的很喜欢它.我正在返回要在Jinja模板中显示的查询,并且返回的我的其中一列包含base64数据.如何解码并显示数据.

I'm new to using python and flask and really like it. I'm returning a query to be displayed in a jinja template and one of my columns being returned has base64 data. How do I decode that data and display it.

推荐答案

在jinja中使用Base64编码的字符串:

In jinja To work with Base64 encoded strings:

{{ encoded | b64decode }}
{{ decoded | b64encode }}

更多信息 http://docs.ansible.com/ansible/playbooks_filters.html

这篇关于Jinja中的Base64解码字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆