Added file for get_data
This commit is contained in:
parent
b5bb341f53
commit
98a2071c0e
1 changed files with 23 additions and 0 deletions
23
paramecio2/libraries/get_data.py
Normal file
23
paramecio2/libraries/get_data.py
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
from settings import config
|
||||||
|
|
||||||
|
wsgi_gateway='flask'
|
||||||
|
|
||||||
|
if hasattr(config, 'wsgi_gateway'):
|
||||||
|
wsgi_gateway=config.wsgi_gateway
|
||||||
|
|
||||||
|
if wsgi_gateway=='flask':
|
||||||
|
|
||||||
|
from flask import request
|
||||||
|
|
||||||
|
def get_query_args(key, default_value=''):
|
||||||
|
|
||||||
|
return request.args.get(key, default_value)
|
||||||
|
|
||||||
|
elif wsgi_gateway=='bottle':
|
||||||
|
|
||||||
|
from bottle import request
|
||||||
|
|
||||||
|
def get_query_args(key, default_value=''):
|
||||||
|
|
||||||
|
return request.query.get(key, default_value)
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue