Browse Source

Bugfix on multisite web run

Now able to run multisite and handled sites. Some addaptations are needed
because handled childs always return 404
Yann Weber 8 years ago
parent
commit
ac75d1cd71
2 changed files with 14 additions and 6 deletions
  1. 9
    5
      lodel/bootstrap.py
  2. 5
    1
      lodel/plugins/multisite_web/run.py

+ 9
- 5
lodel/bootstrap.py View File

@@ -203,16 +203,20 @@ def site_load(data_path):
203 203
     LodelHook.call_hook('lodel2_plugins_loaded', 'bootstrap', None)
204 204
     #triggering boostrapped hook
205 205
     LodelHook.call_hook('lodel2_bootstraped', 'bootstrap', None)
206
-    #Populating FAST_APP_EXPOSAL_CACHE
206
+    #Populating FAST_APP_EXPOSAL_CACHE with wsgi application function
207 207
     #
208 208
     #WARNING !!!! Hardcoded interface name ! Here we have to find the 
209 209
     #interface plugin name in order to populate the cache properly
210
-    FAST_APP_EXPOSAL_CACHE[ctx_name] = LodelContext.module(
211
-        'lodel.plugins.webui.run')
210
+    app = LodelContext.module('lodel.plugins.webui.run')
211
+    #HAS TO be populated in __loader__ context
212
+    LodelContext.set(None)
213
+    LodelContext.expose_modules(globals(), {
214
+        'lodel.plugins.multisite.loader_utils': ['FAST_APP_EXPOSAL_CACHE']})
215
+    FAST_APP_EXPOSAL_CACHE[ctx_name] = app
212 216
     #a dirty & quick attempt to fix context unwanted exite via
213 217
     #hooks
214
-    for name in ( 'LodelHook', 'core_hooks', 'core_scripts',
215
-            'Settings', 'settings', 'logger', 'Plugin'):
218
+    for name in ( 'Plugin', 'LodelHook', 'logger', 'core_hooks',
219
+           'core_scripts'):
216 220
         del(globals()[name])
217 221
     #site fully loaded, switching back to loader context
218 222
     LodelContext.set(None)

+ 5
- 1
lodel/plugins/multisite_web/run.py View File

@@ -40,9 +40,13 @@ except ImportError:
40 40
 import lodel.buildconf #safe even outside contexts
41 41
 import lodel.plugins.multisite.loader_utils as loader_utils
42 42
 lodelsites_name = loader_utils.main()
43
+#FAST_APP_EXPOSAL_CACHE has to be loaded and used from __loader__ context
44
+LodelContext.set(None)
45
+LodelContext.expose_modules(globals(), {
46
+    'lodel.plugins.multisite.loader_utils': ['FAST_APP_EXPOSAL_CACHE']
47
+})
43 48
 LodelContext.set(lodelsites_name)
44 49
 LodelContext.expose_modules(globals(), {
45
-    'lodel.plugins.multisite.loader_utils': ['FAST_APP_EXPOSAL_CACHE'],
46 50
     'lodel.bootstrap': ['site_load'],
47 51
 })
48 52
 FAST_APP_EXPOSAL_CACHE[lodelsites_name] = LodelContext.module(

Loading…
Cancel
Save