cwctl.py
changeset 9288 823cf14bcc37
parent 9287 e70c8c70e344
child 9340 b1e933b0e850
--- a/cwctl.py	Tue Oct 01 16:45:58 2013 +0200
+++ b/cwctl.py	Fri Oct 11 18:00:34 2013 +0200
@@ -1036,12 +1036,26 @@
 
 # WSGI #########
 
+def wsgichoices():
+    try:
+        from werkzeug import serving
+    except ImportError:
+        return ('stdlib',)
+    return ('stdlib', 'werkzeug')
+
 class WSGIDebugStartHandler(InstanceCommand):
     """Start an interactive wsgi server """
     name = 'wsgi'
     actionverb = 'started'
     arguments = '<instance>'
     options = (
+        ('method',
+         {'short': 'm',
+          'type': 'choice',
+          'metavar': '<method>',
+          'default': 'stdlib',
+          'choices': wsgichoices(),
+          'help': 'wsgi utility/method'}),
         ('loglevel',
          {'short': 'l',
           'type' : 'choice',
@@ -1056,7 +1070,11 @@
         config = cwcfg.config_for(appid, debugmode=1)
         init_cmdline_log_threshold(config, self['loglevel'])
         assert config.name == 'all-in-one'
-        from cubicweb.wsgi import server
+        meth = self['method']
+        if meth == 'stdlib':
+            from cubicweb.wsgi import server
+        else:
+            from cubicweb.wsgi import wz as server
         return server.run(config)