How to display a docstring in UI with flask?

I am importing a python script into my flask web app as such

   def register_tasks_in_db():
    from haz import tasks as hz

    tasks = {f'{modname}': importlib.import_module(
        f'haz.tasks.{modname}') for importer, modname, ispkg in

    with app.app_context():
        stored_tasks = Task.query.all()

        for stored_task in stored_tasks:
           if in tasks.keys():
                _ = tasks.pop(
already exists in db')

        for name, obj in tasks.items():
            tasks = Task(name=name)

app = create_app()
app.secret_key = app.config['SECRET_KEY']
worker = create_celery_app(app) # a Celery object

def make_shell_context():
    return {'db': db, 'User': User, 'Institution': Institution,
            'Image': Image, 'Series': Series, 'Study': Study, 
'Device': Device,
            'Task': Task, 'Report': Report}

if __name__ == "__main__":'', port=int(os.getenv('PORT', 5001)))

Each of this tasks contains a docstring. How do I access and display the dosctring in the UI?

I thought I would need to do something like: print(doc)


 for name, obj in tasks.items():
            tasks = Task(name=name)

and then

        'Device': Device,
            'Task': Task, 'Report': Report, 'doc': doc}
Back to Top