Skip to content
This repository has been archived by the owner on Feb 13, 2022. It is now read-only.

Emulate AWS serverless environment (API Gateway + Lambda) in dev and test for Django project

License

Notifications You must be signed in to change notification settings

danielholmes/django-emulate-aws-env

Repository files navigation

Django Emulate AWS Env

image

image

image

Emulates the conditions of an AWS "Serverless" environment (API Gateway + Lambda) in your test and development environments (such as those deployed by Zappa).

Quickstart

Install Django Emulate AWS Env:

pip install django-emulate-aws-env

Add the Django Emulate AWS Env middleware. This should be the highest possible priority in your list and just in your development and test environments:

MIDDLEWARE = [
    'emulate_aws_env.middleware.modify_request',
    ...
]

Or if you're using a dedicated settings file for tests/development:

from .base import *

...

MIDDLEWARE = ['emulate_aws_env.middleware.modify_request'] + MIDDLEWARE

Features

The API Gateway service has the following restrictions which aren't present in the default environment used to test Django projects:

The provided middleware modifies the request to these restrictions.

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox

Credits

Tools used in rendering this package:

About

Emulate AWS serverless environment (API Gateway + Lambda) in dev and test for Django project

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published