Index: cms/bin/test_server.py |
diff --git a/cms/bin/test_server.py b/cms/bin/test_server.py |
index aa39fc49de6ea209ea4e2f58326edc16706825ee..78c6c8f1a0fba63c0457848e9bd2a68ca83f8c22 100644 |
--- a/cms/bin/test_server.py |
+++ b/cms/bin/test_server.py |
@@ -101,6 +101,16 @@ def show_error(start_response, status, **kwargs): |
def handler(environ, start_response): |
path = environ.get("PATH_INFO") |
+ # First check for a relevant URL handler in sitescripts |
+ try: |
+ from sitescripts.web import get_handler |
Sebastian Noack
2015/09/29 11:45:30
I'm not too happy with this change. I don't think
|
+ dynamic_handler = get_handler(path) |
+ except (KeyError, ImportError): |
+ pass |
+ else: |
+ return dynamic_handler(environ, start_response) |
+ |
+ # Otherwise serve a static file / page |
data = get_data(path) |
if data is None: |
return show_error(start_response, "404 Not Found", uri=path) |