Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
:return: :class:`flask:flask.Flask` application
:rtype: :class:`dtale.app.DtaleFlask`
"""
app = DtaleFlask('dtale', reaper_on=reaper_on, static_url_path='', url=url)
app.config['SECRET_KEY'] = 'Dtale'
app.config['HIDE_SHUTDOWN'] = hide_shutdown
app.jinja_env.trim_blocks = True
app.jinja_env.lstrip_blocks = True
app.register_blueprint(dtale)
compress = Compress()
compress.init_app(app)
_, version = retrieve_meta_info_and_version('dtale')
template = dict(
info={
'title': 'D-Tale',
'version': version,
'description': 'Web Client for Visualizing Pandas Objects',
'contact': {
'name': 'Man Alpha Technology',
'email': 'ManAlphaTech@man.com',
'url': 'https://github.com/man-group/dtale'
},
},
host=get_host(host),
schemes=['http'],
)
try:
from flasgger import Swagger # flake8: NOQA
def base_render_template(template, data_id, **kwargs):
"""
Overriden version of Flask.render_template which will also include vital instance information
- settings
- version
- processes
"""
curr_settings = SETTINGS.get(data_id, {})
_, version = retrieve_meta_info_and_version('dtale')
return render_template(
template,
data_id=data_id,
settings=json.dumps(curr_settings),
version=str(version),
processes=len(DATA),
**kwargs
)
def version_info():
"""
:class:`flask:flask.Flask` route for retrieving version information about D-Tale
:return: text/html version information
"""
_, version = retrieve_meta_info_and_version('dtale')
return str(version)