_application WSGIHandler def application environ start_response os env

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
_application = WSGIHandler()
def application(environ, start_response):
os.environ['DJANGO_SETTINGS_MODULE'] = 'asd_settings'
return _application(environ, start_response)
_application2 = WSGIHandler()
def application2(environ, start_response):
os.environ['DJANGO_SETTINGS_MODULE'] = 'huis_settings'
return _application2(environ, start_response)
m = Scheduler(default_priority=priority.LAST, default_timeout=15)
server = wsgi.WSGIServer(
('localhost', 9000),
sync_input(application), #!!! load middleware for wsgi.input
m,
server_name='localhost'
)
server2 = wsgi.WSGIServer(
('localhost', 9001),
sync_input(application2), #!!! load middleware for wsgi.input
m,
server_name='localhost2'
)
m.add(server.serve)
m.add(server2.serve)