diff --git a/.gitignore b/.gitignore index 7afecf8..952da83 100644 --- a/.gitignore +++ b/.gitignore @@ -162,3 +162,4 @@ cython_debug/ # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ +config.json diff --git a/src/toastbin/app.py b/src/toastbin/app.py index d07449a..a2d69c7 100644 --- a/src/toastbin/app.py +++ b/src/toastbin/app.py @@ -1,9 +1,13 @@ from flask import Flask, render_template +import json app = Flask(__name__) +with open('config.json', 'r') as file: + config = json.load(file) +instance = config['instance']['domain'] @app.route("/") def index(): - return render_template('index.j2') + return render_template('index.j2', instance=instance) app.run(debug=True) diff --git a/src/toastbin/config.sample.json b/src/toastbin/config.sample.json new file mode 100644 index 0000000..3ccd3ea --- /dev/null +++ b/src/toastbin/config.sample.json @@ -0,0 +1,5 @@ +{ + "instance": { + "domain": "example.com" + } +}