config
This commit is contained in:
parent
3a264bff09
commit
f4b3fd98b8
3 changed files with 11 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -162,3 +162,4 @@ cython_debug/
|
|||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||
#.idea/
|
||||
|
||||
config.json
|
||||
|
|
|
@ -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)
|
||||
|
|
5
src/toastbin/config.sample.json
Normal file
5
src/toastbin/config.sample.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"instance": {
|
||||
"domain": "example.com"
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue