Error message: "'NoneType' object is not callable". – received from zappa deployed django application on AWS Lambda


I’m running into an error after deploying my django app to lambda using zappa.

This is the error:

{'message': 'An uncaught exception happened while servicing this request. You can investigate this with the `zappa tail` command.', 'traceback': ['Traceback (most recent call last):', ' File /var/task/, line 540, in handler with Response.from_app(self.wsgi_app, environ) as response:', ' File /var/task/werkzeug/wrappers/, line 287, in from_app return cls(*_run_wsgi_app(app, environ, buffered))', ' File /var/task/werkzeug/wrappers/, line 26, in _run_wsgi_app return _run_wsgi_app(*args)', ' File /var/task/werkzeug/, line 1119, in run_wsgi_app app_rv = app(environ, start_response)', TypeError: 'NoneType' object is not callable]}

These are my zappa settings:

  "production": {
    "aws_region": "eu-west-2",
    "django_settings": "app.settings",
    "profile_name": "deployment",
    "project_name": "app",
    "runtime": "python3.6",
    "s3_bucket": "zappa-deployment-uploads",
    "slim_handler": true,
    "exclude": [".ebextensions/", ".elasticbeanstalk/", "webpack/", "app/static/"],
    "vpc_config" : {
    "SubnetIds": [ "..."],
    "SecurityGroupIds": ["..."]

I’ve ensured that my API Gateway hostname has been added to my allowed hosts setting and redeployed.

I’ve called zappa tail, but it gives me an even shorter error respons "’NoneType’ object is not callable".

Can anyone understand why I would be getting this?


You have an exception being thrown in your code. I have found NoneType is a generic error when using AWS Lambda & Zappa that is masking the true issue.

Some debugging steps:

  1. Ensure your code works locally when you run python runserver
  2. Output console messages in various places in your code and run zappa tail to identify the section of code that is having troubles
  3. Repeat above option until you have narrowed the location of the problem.

Answered By – Edgar

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published