This repository has been archived on 2025-07-30. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
ia-short/liteshort.py

28 lines
641 B
Python

from flask import Flask
import yaml
def load_config():
new_config = yaml.load(open("config.yml"))
if "admin_hashed_password" in new_config.keys():
new_config["password"] = new_config["admin_hashed_password"]
elif "admin_password" in new_config.keys():
new_config["password"] = new_config["admin_password"]
else:
raise Exception("admin_password or admin_hashed_password must be set in config.yml")
return new_config
config = load_config()
print(config["password"])
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World!'
if __name__ == '__main__':
app.run()