Custom template filter bin_2_img

This commit is contained in:
Mike Young
2019-11-17 09:45:24 -05:00
parent 99cdc60c47
commit c60e52a1fb
3 changed files with 11 additions and 0 deletions

View File

@@ -38,6 +38,7 @@ INSTALLED_APPS = [
'django.contrib.messages',
'django.contrib.staticfiles',
'interface',
'interface.templatetags'
]
MIDDLEWARE = [

View File

@@ -0,0 +1,10 @@
from base64 import b64encode
from django import template
register = template.Library()
@register.filter
def bin_2_img(_bin):
if _bin is not None: return b64encode(_bin)