mirror of
https://github.com/yweber/lodel2.git
synced 2025-11-12 17:09:16 +01:00
Bugfix on multisite web run
Now able to run multisite and handled sites. Some addaptations are needed because handled childs always return 404
This commit is contained in:
parent
56cd806ceb
commit
ac75d1cd71
2 changed files with 14 additions and 6 deletions
|
|
@ -203,16 +203,20 @@ def site_load(data_path):
|
|||
LodelHook.call_hook('lodel2_plugins_loaded', 'bootstrap', None)
|
||||
#triggering boostrapped hook
|
||||
LodelHook.call_hook('lodel2_bootstraped', 'bootstrap', None)
|
||||
#Populating FAST_APP_EXPOSAL_CACHE
|
||||
#Populating FAST_APP_EXPOSAL_CACHE with wsgi application function
|
||||
#
|
||||
#WARNING !!!! Hardcoded interface name ! Here we have to find the
|
||||
#interface plugin name in order to populate the cache properly
|
||||
FAST_APP_EXPOSAL_CACHE[ctx_name] = LodelContext.module(
|
||||
'lodel.plugins.webui.run')
|
||||
app = LodelContext.module('lodel.plugins.webui.run')
|
||||
#HAS TO be populated in __loader__ context
|
||||
LodelContext.set(None)
|
||||
LodelContext.expose_modules(globals(), {
|
||||
'lodel.plugins.multisite.loader_utils': ['FAST_APP_EXPOSAL_CACHE']})
|
||||
FAST_APP_EXPOSAL_CACHE[ctx_name] = app
|
||||
#a dirty & quick attempt to fix context unwanted exite via
|
||||
#hooks
|
||||
for name in ( 'LodelHook', 'core_hooks', 'core_scripts',
|
||||
'Settings', 'settings', 'logger', 'Plugin'):
|
||||
for name in ( 'Plugin', 'LodelHook', 'logger', 'core_hooks',
|
||||
'core_scripts'):
|
||||
del(globals()[name])
|
||||
#site fully loaded, switching back to loader context
|
||||
LodelContext.set(None)
|
||||
|
|
|
|||
|
|
@ -40,9 +40,13 @@ except ImportError:
|
|||
import lodel.buildconf #safe even outside contexts
|
||||
import lodel.plugins.multisite.loader_utils as loader_utils
|
||||
lodelsites_name = loader_utils.main()
|
||||
#FAST_APP_EXPOSAL_CACHE has to be loaded and used from __loader__ context
|
||||
LodelContext.set(None)
|
||||
LodelContext.expose_modules(globals(), {
|
||||
'lodel.plugins.multisite.loader_utils': ['FAST_APP_EXPOSAL_CACHE']
|
||||
})
|
||||
LodelContext.set(lodelsites_name)
|
||||
LodelContext.expose_modules(globals(), {
|
||||
'lodel.plugins.multisite.loader_utils': ['FAST_APP_EXPOSAL_CACHE'],
|
||||
'lodel.bootstrap': ['site_load'],
|
||||
})
|
||||
FAST_APP_EXPOSAL_CACHE[lodelsites_name] = LodelContext.module(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue