Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def wsgi(**args):
"""Initializes everything, loads apps, returns the wsgi app"""
initialize(**args)
Reloader.import_apps()
return bottle.default_app()
def reload(name=None):
"""Reloads installed apps"""
Reloader.import_app(name) if name else Reloader.import_apps()
return "ok"
print("") # Insert a blank line to improve readability
# If we know where the password is stored, read it, otherwise ask for one
if args.dashboard_mode not in ("demo", "none") and not os.path.exists(
args.password_file
):
password = getpass.getpass("Choose a one-time dashboard password: ")
print('Storing the hashed password in file "%s"' % args.password_file)
with open(args.password_file, "w") as fp:
fp.write(str(pydal.validators.CRYPT()(password)[0]))
# Store all args in environment variables to make them available to the following processes
# and create any missing folders
initialize(**args.__dict__)
if os.path.exists(os.path.join(args.apps_folder, "_dashboard")):
print("Dashboard is at: http://%s:%s/_dashboard" % (args.host, args.port))
# start
Reloader.import_apps()
start_server(args)