[Solved]-Using Django ORM inside an AWS Lambda function

14👍

If you only want to use Django’s ORM (no views, admin, templates), then yes, you can use Django ORM in AWS Lambda as a library and no need for Zappa.

You can see how to do it from here: Using only the DB part of Django

However, take note that in AWS Lambda, you are billed per 100ms of execution time and Django ORM is not exactly fast (vs. direct raw queries).

It is recommended that you keep your Lambdas as lean as possible. Loading up the entire Django package is opposite of that recommendation.

Leave a comment