start implementing a proxy layer for the API of creativecommons.tankerkoenig.de
This commit is contained in:
parent
af6f271b29
commit
47e81c7517
|
@ -1,4 +1,4 @@
|
||||||
from flask import url_for, redirect, render_template
|
from flask import url_for, redirect, render_template, request
|
||||||
from flask_security import login_required
|
from flask_security import login_required
|
||||||
from flask_security.core import current_user
|
from flask_security.core import current_user
|
||||||
from sqlalchemy.exc import IntegrityError
|
from sqlalchemy.exc import IntegrityError
|
||||||
|
@ -129,3 +129,20 @@ def delete_account():
|
||||||
|
|
||||||
return render_template('deleteAccountForm.html', form=form)
|
return render_template('deleteAccountForm.html', form=form)
|
||||||
|
|
||||||
|
|
||||||
|
@app.route('/filling_stations', methods=['GET'])
|
||||||
|
#@login_required
|
||||||
|
def query_filling_stations():
|
||||||
|
api_key = app.config['TANKERKOENIG_API_KEY']
|
||||||
|
lat = request.args.get('latitude')
|
||||||
|
lon = request.args.get('longitude')
|
||||||
|
rad = request.args.get('radius', default=10)
|
||||||
|
type = request.args.get('type', default='all')
|
||||||
|
sort = request.args.get('sort', default='price')
|
||||||
|
return lat
|
||||||
|
|
||||||
|
@app.route('/filling_stations/<fsid>', methods=['GET'])
|
||||||
|
#@login_required
|
||||||
|
def query_filling_station_details(fsid):
|
||||||
|
api_key = app.config['TANKERKOENIG_API_KEY']
|
||||||
|
return fsid
|
||||||
|
|
|
@ -18,6 +18,7 @@ class Config:
|
||||||
MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
|
MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
|
||||||
MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
|
MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
|
||||||
ADMIN_MAIL = 'joachim@lusiardi.de'
|
ADMIN_MAIL = 'joachim@lusiardi.de'
|
||||||
|
TANKERKOENIG_API_KEY = os.environ.get('TANKERKOENIG_API_KEY')
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def init_app(app):
|
def init_app(app):
|
||||||
|
|
Loading…
Reference in New Issue