diff --git a/webnotes/app.py b/webnotes/app.py index 14b7c1f7b4..b114385c98 100644 --- a/webnotes/app.py +++ b/webnotes/app.py @@ -4,6 +4,7 @@ sys.path.extend(["..", "../app", "../lib"]) from werkzeug.wrappers import Request, Response from werkzeug.local import LocalManager +from werkzeug.wsgi import SharedDataMiddleware import mimetypes import webnotes @@ -37,11 +38,15 @@ def application(request): application = local_manager.make_middleware(application) + +application = SharedDataMiddleware(application, { + '/': os.path.join(os.path.dirname(__file__), "..", "..", "public") +}) + if __name__ == '__main__': import sys from werkzeug.serving import run_simple run_simple('localhost', 8000, application, use_reloader=True, - use_debugger=True, use_evalex=True, static_files = { - "/": os.path.join(os.path.dirname(__file__), "..", "..", "public") - }) \ No newline at end of file + use_debugger=True, use_evalex=True) + diff --git a/webnotes/handler.py b/webnotes/handler.py index d847a7c21f..6cf15eab7d 100755 --- a/webnotes/handler.py +++ b/webnotes/handler.py @@ -156,8 +156,6 @@ def print_json(): import json - print webnotes.response - print_zip(json.dumps(webnotes.local.response, default=json_handler, separators=(',',':'))) def print_csv():