Permalink
Browse files

bug 816519 - middleware.wsgi app, r=rhelmer

  • Loading branch information...
1 parent a64be72 commit 69fd921a5266f88ec06147ee20741c22c8403c61 @peterbe peterbe committed Dec 6, 2012
Showing with 23 additions and 7 deletions.
  1. +4 −7 config/middleware.ini-dist
  2. +19 −0 wsgi/middleware.wsgi
View
@@ -1,8 +1,3 @@
-# name: application
-# doc: the fully qualified module or class of the application
-# converter: configman.converters.class_converter
-application='MiddlewareApp'
-
[web_server]
# name: ip_address
@@ -19,6 +14,8 @@ application='MiddlewareApp'
# doc: a class implementing a wsgi web server
# converter: configman.converters.class_converter
#wsgi_server_class='socorro.webapi.servers.CherryPy'
+ # If you want to use mod_wsgi enable this:
+ #wsgi_server_class='socorro.webapi.servers.ApacheModWSGI'
[implementations]
@@ -41,7 +38,7 @@ application='MiddlewareApp'
# all or a subset of the apps, uncomment the +include line below
# and edit the 'common_database.ini' file instead of using the individual
# values below.
- #+include common_database.ini
+ #+include /absolute/path/to/common_database.ini
# name: database_host
# doc: the hostname of the database
@@ -101,7 +98,7 @@ application='MiddlewareApp'
# all or a subset of the apps, uncomment the +include line below
# and edit the 'common_logging.ini' file instead of using the individual
# values below.
- #+include common_logging.ini
+ #+include /absolute/path/to/common_logging.ini
# name: stderr_error_logging_level
# doc: logging level for the logging to stderr (10 - DEBUG, 20 - INFO, 30 - WARNING, 40 - ERROR, 50 - CRITICAL)
View
@@ -0,0 +1,19 @@
+import os
+from socorro.app.generic_app import main
+from socorro.middleware.middleware_app import MiddlewareApp
+from socorro.webapi.servers import ApacheModWSGI
+import socorro.middleware.middleware_app
+
+if os.path.isfile('/etc/socorro/middleware.ini'):
+ config_path = '/etc/socorro'
+else:
+ config_path = ApacheModWSGI.get_socorro_config_path(__file__)
+
+# invoke the generic main function to create the configman app class and which
+# will then create the wsgi app object.
+main(
+ MiddlewareApp, # the socorro app class
+ config_path=config_path
+)
+
+application = socorro.middleware.middleware_app.application

0 comments on commit 69fd921

Please sign in to comment.