Using Django in AWS lambda

Viewed 201

I'm writing a simple http server in aws lambda and would like to use Django, however I'm not looking to deploy an entire django app on lambda through zappa.

Is there any way to just import django's HttpResponse library in a lambda function like below?

from django.http import HttpResponse

def lambda_handler(event, context):
    # TODO implement

    msg = "hello its me"

    return HttpResponse(msg, content_type='text/plain')

I've already created a deployment package with all the django libraries inside and uploaded to lambda, but I'm getting an error:

Requested setting DEFAULT_CHARSET, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.: ImproperlyConfigured

any help is appreciated, thanks in advance!

0 Answers
Related