I suppose you could put web2py in one directory, and then symlink to an 
application folder in some other directory. But it seems odd that you 
somehow don't have control over how the application code gets updated. 
There are lots of mechanisms by which you could update application code. 
For example, if you need to ensure that after the files in an application 
folder are updated some additional special file gets injected into the 
folder, you could presumably use a script or an automation tool such as 
Ansible to manage the whole process.

Actually, if all you need is to set some configuration options, you could 
do that by putting them in (a) a Python module that gets imported by the 
app, (b) a configuration file that gets loaded via AppConfig, (c) OS 
environment variables, etc.

The point is, the details depend on exactly what aspects of the system need 
to be made modular as well as the mechanism by which app code will be 
updated. And the solution(s) will likely be largely independent of web2py, 
relying more on standard Python mechanisms (e.g., imports), OS features 
(e.g., symlinks), and various development/deployment tools (e.g., bash 
scripts, git, Ansible, etc.).

Anyway, if you have a particular setup and workflow in mind, perhaps you 
can explain how it would be achieved when using an alternative web 
framework (either another Python framework, such as Django or Flask) or a 
PHP framework. Then maybe we can see if there is an analog for web2py.

 My understanding is that we can redefine the application in  
> wsgihandler.py, so create a wrapper over it. However, I am puzzle because I 
> do not know what information is available at this stage (regarding 
> pathinfo, etc.)  and where will I store the information that I need to pass 
> to the wrapped application.
>

See https://www.python.org/dev/peps/pep-3333/#environ-variables. You should 
be able to add items to the environment dictionary that ultimately gets 
passed to gluon.main.wsgibase, which would then be available in request.env.

Anyway, for simply setting some configuration options, this approach is 
overkill. Just use a Python import, configuration file, or OS environment 
variables.

Anthony

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to