Pārlūkot izejas kodu

better uwsgi runner for both web and webdav

Guénaël Muller 6 gadus atpakaļ
vecāks
revīzija
50bda15ef0
3 mainītis faili ar 16 papildinājumiem un 5 dzēšanām
  1. 4 2
      README.md
  2. 9 0
      wsgi/web.py
  3. 3 3
      wsgi/webdav.py

+ 4 - 2
README.md Parādīt failu

84
 
84
 
85
 Run all services with uwsgi
85
 Run all services with uwsgi
86
 
86
 
87
+    # set tracim_conf_file path
88
+    set TRACIM_CONF_PATH="$(pwd)/development.ini"
87
     # pyramid webserver
89
     # pyramid webserver
88
-    uwsgi -d /tmp/tracim_web.log --http-socket :6543 --ini-paste-logged  development.ini -H env --pidfile /tmp/tracim_web.pid
90
+    uwsgi -d /tmp/tracim_web.log --http-socket :6543 --wsgi-file wsgi/web.py -H env --pidfile /tmp/tracim_web.pid
89
     # webdav wsgidav server
91
     # webdav wsgidav server
90
-    uwsgi -d /tmp/tracim_webdav.log --http-socket :3030 --wsgi-file wsgi//webdav.py  development.ini -H env --pidfile /tmp/tracim_webdav.pid
92
+    uwsgi -d /tmp/tracim_webdav.log --http-socket :3030 --wsgi-file wsgi/webdav.py -H env --pidfile /tmp/tracim_webdav.pid
91
 
93
 
92
 to stop them:
94
 to stop them:
93
 
95
 

+ 9 - 0
wsgi/web.py Parādīt failu

1
+# coding=utf-8
2
+# Runner for uwsgi
3
+import os
4
+import pyramid.paster
5
+
6
+config_uri = os.environ['TRACIM_CONF_PATH']
7
+
8
+pyramid.paster.setup_logging(config_uri)
9
+application = pyramid.paster.get_app(config_uri)

+ 3 - 3
wsgi/webdav.py Parādīt failu

1
 # coding=utf-8
1
 # coding=utf-8
2
 # Runner for uwsgi
2
 # Runner for uwsgi
3
 from tracim.lib.webdav import WebdavAppFactory
3
 from tracim.lib.webdav import WebdavAppFactory
4
+import os
4
 
5
 
5
-APP_CONFIG = "development.ini"
6
-
6
+config_uri = os.environ['TRACIM_CONF_PATH']
7
 app_factory = WebdavAppFactory(
7
 app_factory = WebdavAppFactory(
8
-    tracim_config_file_path=APP_CONFIG,
8
+    tracim_config_file_path=config_uri,
9
 )
9
 )
10
 application = app_factory.get_wsgi_app()
10
 application = app_factory.get_wsgi_app()