DEV Community


Discussion on: Deploying a Django project on AWS Lambda using Serverless (Part 1)

vaddimart profile image
Vadim Khodak Author

Hi Kostja,

I didn't have experience with Zappa. I tried it one time.
Zappa/Serverless is just a one of ways to deploy Django App on AWS infrastructure.
I think for some cases it will be better to use Zappa for other casses it is better to use Serverless or something else.

The same thing is about using EC2 instances vs AWS Lambdas.

About using nice json format, from my personal point of view yaml is more human readble format than json. But it is just my personal opinion. ("Many people many minds")

I have a couple of small projects (based on trafic) where Django is deployed on AWS Lambdas and it works well.

Regarding async task, I may be wrong, I think that if it will not work as async function if you call it from sync function. Django is not async framework, as far as I know.

Thank you for your comment here. I appreciate it.

kostjapalovic profile image

Hey. Thanks for the response.

I don't honestly care about json vs yaml. I mean i will not go in a holywar abou it :D but probably yaml is more human readable.

Anyway, the whole question was to make sure if i am missing out on not looking hard into the Serverless framework, maybe it is somehow superior to Zappa or anything like that.

From what I understand it is not and both are just possible options, if I understood you right. Thanks again.

Now about async stuff.

If a function is wrapped in a Zappa @task, then when it is called it checks if it is called in lambda environment. in this case it invokes a lambda function goes on.

So this invocation on cold dev/staging environment(when there are no concurrent requests, for example when only one me playing with the app) it takes quite a while to invoke it. But it feels that it gets faster once at least 2-3 people work with the app in parallel.

Anyway. Thanks again for the post!
Great work!

Thread Thread
vaddimart profile image
Vadim Khodak Author

Thank you for the feedback.

In Serverless you also can call another Lambda function from Django Lambda. But I think it is a bit more complex than just @task decorator. There are a lot of plugins for Serverless framework. One of them serverless-plugin-warmup. It can help you to keep warm your lambdas.