The PEP defines that you should create a callable, and does not stipulate what name it should use. The name simple_app()
is just an example name; below it is another example that uses a class named AppClass
.
Further on, in the Application Configuration section the PEP states:
This specification does not define how a server selects or obtains an application to invoke. These and other configuration options are highly server-specific matters. It is expected that server/gateway authors will document how to configure the server to execute a particular application object, and with what options (such as threading options).
Each WSGI server needs to be configured to load the callable, but often they have a default. uwsgi
looks for an object named application
as its default.
You can tell uwsgi
to look for a different name by using the callable
option:
Argument: string Default: application
Set default WSGI callable name.
For your example that'd be:
uwsgi --socket 127.0.0.1:9090 --wsgi-file /www/app.py --callable simple_app