Skip to content

Commit 2642587

Browse files
committed
Merge pull request binarymatt#94 from salimane/upstream
add WSGI callable function to be able to run application under uwsgi
2 parents a442660 + b68f036 commit 2642587

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

resweb/server.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import os
2-
from itty import Redirect, get, post, serve_static_file, run_itty
2+
from itty import Redirect, get, post, serve_static_file, run_itty, handle_request
33
from pyres import ResQ
44
from pyres import failure
55
from views import (
@@ -118,6 +118,9 @@ def my_media(request, filename):
118118
#return static_file(request, filename=filename, root=my_root)
119119

120120

121+
# The hook to make it run in a mod_wsgi environment.
122+
def application(environ, start_response):
123+
return handle_request(environ, start_response)
121124

122125
if __name__ == "__main__":
123126
run_itty()

0 commit comments

Comments
 (0)