Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

338
Views
how can I fix a wsgi error on beanstlak app using Python and fastapi

I am using Python and fasatpi (web framework). My application.py file is:

from fastapi import FastAPI
import uvicorn

application = FastAPI()


@application.get("/")
def read_root():
    return {"Hello": "World"}



if __name__ == "__main__":
    uvicorn.run("application:application", host="127.0.0.1", port=5000, log_level="info")

This runs fine on local machine by running python application.py

However when I deploy to an elastic beanstalk on AWS, after multiple failed attempts and also experimenting with a Procfile, as follows:

web: uvicorn application:app --host=0.0.0.0 --port=${PORT:-5000}

And repeated error is:

[

Tue Jun 16 08:58:16.659854 2020] [mpm_prefork:notice] [pid 8242] AH00163: Apache/2.4.43 (Amazon) mod_wsgi/3.5 Python/3.6.10 configured -- resuming normal operations
[Tue Jun 16 08:58:16.659870 2020] [core:notice] [pid 8242] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Tue Jun 16 08:58:19.704522 2020] [:error] [pid 8247] [remote 127.0.0.1:0] mod_wsgi (pid=8247): Exception occurred processing WSGI script '/opt/python/current/app/application.py'.
[Tue Jun 16 08:58:19.704608 2020] [:error] [pid 8247] [remote 127.0.0.1:0] TypeError: __call__() missing 1 required positional argument: 'send'

How can I fix this? Many thanks.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!