Django Lambda Gateway Interface
Project description
django-lgi - Django Lambda Gateway Interface
django-lgi is a python module that interprets HTTP API requests sent to your Django project in Lambda.
Features
- Process 2.0 payload format version data that API Gateway sends to a Lambda integration.
- Trigger management commands directly on lambda, e.g. invoke lambda function with
{"manage": ["version"]}
to display the current Django version.
Installation
pip install django-lgi
Usage
Create lgi.py
file in Django project root. Remember to replace mysite.settings
with dotted path to your settings module.
import os
from lgi import get_lgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
application = get_lgi_application()
Set lambda handler to mysite.lgi.application
.
Examples
- Djambda - example project setting up Django application in AWS Lambda managed by Terraform.
Related Projects
Testing
To run the test suite, first, create and activate a virtual environment. Then run tests.
$ flit install -s
$ cd tests
$ ./runtests.py
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 Distribution
django-lgi-0.1.0.tar.gz
(7.1 kB
view hashes)
Built Distribution
Close
Hashes for django_lgi-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1823133c4acf944b7154cceb1235d61ee1a52c3bde1966c6dc34bcffb8a7140 |
|
MD5 | 0eba7b1ae475ac826077d1f7e0995b68 |
|
BLAKE2b-256 | 3036fbe838dba1ffc8f2c5c5c3069d4c4d4949c403735b47d27217161b60b90b |