-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathninox_api.py
More file actions
32 lines (22 loc) · 1020 Bytes
/
ninox_api.py
File metadata and controls
32 lines (22 loc) · 1020 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from flask import Flask, render_template
from flask_bootstrap import Bootstrap
import requests
app = Flask(__name__)
Bootstrap(app)
@app.route('/')
def hello():
return render_template('home.html')
@app.route('/mitglieder')
def mitglieder():
headers = {"Authorization":"Bearer 5a3a3430-a6b7-11e8-833a-c390db8727db"}
endpoint = 'https://api.ninoxdb.de/v1/teams/g7DEtaLSmfv2pByid/databases/uyvkcqihm64r/tables/E/records'
mitglieder = requests.get(endpoint, headers=headers).json()
return render_template('mitglieder.html', title = 'Mitglieder', mitglieder = mitglieder)
@app.route('/projekte')
def projekte():
headers = {"Authorization":"Bearer 5a3a3430-a6b7-11e8-833a-c390db8727db"}
endpoint = 'https://api.ninoxdb.de/v1/teams/g7DEtaLSmfv2pByid/databases/uyvkcqihm64r/tables/A/records'
projekte = requests.get(endpoint, headers=headers).json()
return render_template('projekte.html', title = 'Projekte', projekte = projekte)
if __name__ == '__main__':
app.run(debug=True)