Commits

Ginés Martínez Sánchez  committed 1ee4e85 Draft

developing wsgi server

  • Participants
  • Parent commits 8c9d028

Comments (0)

Files changed (3)

File ginsfsm/examples/wsgi/simple_wsgi_server.ini

+[composite:main]
+use = call:ginsfsm.gaplic:gaplic_factory
+main = wsgi-server
+threads =
+subprocesses =
+others = wsgi-application
+
+[app:wsgi-server]
+use = call:ginsfsm.examples.wsgi.simple_wsgi_server:main
+wsgi-server.host = 0.0.0.0
+wsgi-server.port = 8000
+wsgi-server.application = app:wsgi-application
+GSock.trace_dump = true
+GObj.trace_mach = true
+
+[app:wsgi-application]
+use = call:ginsfsm.examples.wsgi.simple_wsgi_server:paste_app_factory
+
+# Begin logging configuration
+
+[loggers]
+keys = root, ginsfsm
+
+[handlers]
+keys = console
+
+[formatters]
+keys = generic
+
+[logger_root]
+level = DEBUG
+handlers = console
+
+[logger_ginsfsm]
+level = DEBUG
+handlers =
+qualname = ginsfsm
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[formatter_generic]
+format = %(message)s
+
+# End logging configuration

File ginsfsm/examples/wsgi/simple_wsgi_server.py

 #===============================================================
 #                   Main
 #===============================================================
-def main(global_config, **local_conf):
+def main(global_config, **settings):
     """ Entry point to run with gserve (PasteDeploy)
     """
-    ga = GAplic('Wsgi-Example', **local_conf)
+    ga = GAplic('Wsgi-Example', **settings)
     ga.create_gobj(
         'wsgi-server',
         GWsgiServer,
         None,
-        host='0.0.0.0',
-        port=8000,
         application=application
     )
     return ga
         'GObj.trace_mach': True,
         'GObj.logger': logging,
         'GSock.trace_dump': True,
+        'host': '0.0.0.0',
+        'port': 8002,
     }
     ga = main({}, **local_conf)
 

File ginsfsm/examples/wsgi/wsgi-server.ini

 others = wsgi-application
 
 [app:wsgi-server]
-use = call:ginsfsm.examples.example6-wsgi-server:main
+use = call:ginsfsm.examples.wsgi.simple_wsgi_server:main
 wsgi-server.host = 0.0.0.0
 wsgi-server.port = 8001
 wsgi-server.application = app:wsgi-application
 GObj.trace_mach = true
 
 [app:wsgi-application]
-use = call:ginsfsm.examples.example6-wsgi-server:paste_app_factory
+use = call:ginsfsm.examples.wsgi.simple_wsgi_server:paste_app_factory
 
 # Begin logging configuration