Python3.6+ module to make Flask compatible with AWS Lambda
Project description
flask-lambda-python3.6
============
**Python 3.6+**
For older versions of python use the [original flask-lambda library](https://github.com/sivel/flask-lambda) which this code is adapted from.
See [this example flask project](https://github.com/techjacker/flask-lambda-example) for how to use and deploy a flask app using this library.
Installation
------------
pip install flask-lambda-python36
Usage
-----
from flask_lambda import FlaskLambda
app = FlaskLambda(__name__)
@app.route('/foo', methods=['GET', 'POST'])
def foo():
data = {
'form': request.form.copy(),
'args': request.args.copy(),
'json': request.json
}
return (
json.dumps(data, indent=4, sort_keys=True),
200,
{'Content-Type': 'application/json'}
)
if __name__ == '__main__':
app.run(debug=True)
============
**Python 3.6+**
For older versions of python use the [original flask-lambda library](https://github.com/sivel/flask-lambda) which this code is adapted from.
See [this example flask project](https://github.com/techjacker/flask-lambda-example) for how to use and deploy a flask app using this library.
Installation
------------
pip install flask-lambda-python36
Usage
-----
from flask_lambda import FlaskLambda
app = FlaskLambda(__name__)
@app.route('/foo', methods=['GET', 'POST'])
def foo():
data = {
'form': request.form.copy(),
'args': request.args.copy(),
'json': request.json
}
return (
json.dumps(data, indent=4, sort_keys=True),
200,
{'Content-Type': 'application/json'}
)
if __name__ == '__main__':
app.run(debug=True)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for flask_lambda_python36-0.1.0-py36-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7a7ccef0ea6a2bc68d3a589bd7e8a58cff7dccfc8818cf06f40b4dedfb20552 |
|
MD5 | d52f17c075ab7c86a2ec7c705aaec09f |
|
BLAKE2b-256 | 9ad4c0a8691311568c7c34eb24df6391d9cdb88d3f6476fea6accc5f82696adb |