from pyramid.config import Configurator
from pyramid.renderers import JSON


def main(global_config, **settings):
    with Configurator(settings=settings) as config:
        config.add_renderer('json', JSON(indent=4))
        config.include('ns_portal.database')
        config.include('ns_portal.core.resources')
        config.include('ns_portal.routes')
        config.include('ns_portal.utils')

    return config.make_wsgi_app()

@@ -68,16 +68,30 @@
 rt JSON%0A
+import base64%0A
 %0A%0Adef ma
@@ -173,16 +173,203 @@
 config:%0A
+        def bytes_adapter(obj, request):%0A            return base64.b64encode(obj).decode()%0A        json_renderer = JSON(indent=4)%0A        json_renderer.add_adapter(bytes, bytes_adapter)%0A%0A
         
@@ -396,30 +396,29 @@
 'json', 
-JSON(indent=4)
+json_renderer
 )%0A      
@@ -456,16 +456,64 @@
 abase')%0A
+        config.include('ns_portal.core.policy')%0A
         

include policy in app and add adapter for handle img binary in db