Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"""Configure view
url route configure.
:param app: Flask app object
:param config: view's config
:type config: dict
"""
from .view_old import CView
if not view_packages:
return
for package_path in view_packages:
iterate_package(import_module(package_path))
for view in CView.__subclasses__():
name = class_name_to_api_name(view.__name__)
uri = '/%s/%s' % (view.__module__.split('.')[0], name)
endpoint = '%s.%s' % (view.__module__.split('.')[0], name)
app.add_url_rule(uri, view_func=view.as_view(endpoint, uri, app))