Skip to content Skip to sidebar Skip to footer

Typeerror: Takes No Arguments (2 Given) When Using Wsgi In Python 2.7

I am using mod-wsgi with Apache 2.2 I have the following in WSGI script import sys sys.path.insert(0, '') from optimization_app import optimizeInstances as a

Solution 1:

This is occurring because you used it as the WSGI application object.

from optimization_app import optimizeInstances as application

A WSGI application is required to accept two parameters environ and start_response. So when the WSGI server is calling that function to have your application handle a request it is failing with that error.

The way you are using that function is simply wrong. Your actual WSGI application is being created inside of that function in local scope, so how would it be accessed anyway.

Would suggest you check back and look at the Flask getting started documentation.

Solution 2:

As I see u defined optimizeInstances() with No arguments. You might be calling optimizeInstances() function by passing 2 arguments to it.

Post a Comment for "Typeerror: Takes No Arguments (2 Given) When Using Wsgi In Python 2.7"