This video is available to students only

Using WhiteNoise for static files

Serve static files directly from your project

We are mostly following the Using WhiteNoise with Django guide here, but with some specific changes for the Lambda environment.

Install WhiteNoise#

We'll use pip to install WhiteNoise:

Configure Django Settings#

Now edit the Django settings file to support WhiteNoise settings. Add these lines to the bottom of the file. This will enable WhiteNoise to be the default for static files.

And then add the WhiteNoise middleware right after django.middleware.security.SecurityMiddleware

 

This page is a preview of Serverless Django with Zappa

Start a new discussion. All notification go to the author.