Static file options
A brief overview of two solutions
The Django project has some strategies for deploying static files but in AWS Lambda, we have very different considerations. There are two common options.
Option 1 - serve static files from your Zappa project#
You can configure your app to serve static files using the package WhiteNoise. This enables your Django application not only to execute your Django views, but also deliver these static files when requested. This is normally not done by Django, because the web server (like Apache or NGINX) does this job. But since there is no web server we can configure, this package was created.
The advantages of this option are that your app has fewer dependencies. It doesn't rely on other AWS services or tools. It's also nice since usually your static files are tightly coupled with your application.
Additionally, WhiteNoise does a good job of compressing files before sending them to the web client. This speeds up the delivery of important assets and makes the web pages render faster.
This page is a preview of Serverless Django with Zappa