OK let's just use WEB2PY_MODE than and it will appear in

request.env.web2py_mode

Notice we aready have

request.env.web2py_path
request.env.web2py_version

Massimo


On Jan 29, 10:33 am, Robin B <robi...@gmail.com> wrote:
> Maybe web2py could endorse a 'standard' env variable, so people do not
> have to set more than one:
>
> WEB2PY_ENV_MODE = DEVELOPMENT | PRODUCTION | TEST | BENCHMARK
>
> I think environment modes are important especially for performance.
> If your app spends <1% of requests in development, and >99% in
> production, it makes sense to set production mode so you can cache
> aggressively, avoid reading the disk/reloading, and avoid doing
> redundant operations on >99% of your requests.
>
> Robin
>
> On Jan 29, 9:22 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > This would be considered a web2py level configuration flag and that is
> > against to web2py phylosophy (no configuration).
>
> > You should be able to mimic it anyway.
>
> > you can set a environment variable (before starting web2py) and you
> > should be able to see it in request.env.your_environment_variable.
>
> > Massimo
>
> > On Jan 29, 9:10 am, rctay <rcta...@gmail.com> wrote:
>
> > > Oh i see.
>
> > > Well what I'm proposing is that such a workflow (ie with a development
> > > flag) is shared with web2py users, not just among ourselves. :)
>
> > > On Jan 29, 10:58 pm, achipa <attila.cs...@gmail.com> wrote:
>
> > > > I'm using svn and bzr. The conf.py file is usually on an ignore list
> > > > and I provide a conf.example.py file (commented example entries) for
> > > > reference. That way I have no live config data in the versioning
> > > > system, and update/commit does not change the config file, so all is
> > > > well (this is actually not web2py related, I use a similar setup in my
> > > > other projects, too). If the config file needs to be changed on situ,
> > > > I can do that via the web2py interface which is preferred to me
> > > > (restarting apache being the other option if I need to change command
> > > > line parameters).
>
> > > > On Jan 29, 3:25 pm, rctay <rcta...@gmail.com> wrote:
>
> > > > > Hmm, you don't sound like you're using any VCS/SCM.
>
> > > > > anyway, by using that flag, you could minimize the possibility of
> > > > > human error (ie. the possibility that you forgot to update that
> > > > > variable on either setup while moving code between both).
>
> > > > > you could also debug your deployment setup quickly by turning on that
> > > > > flag.
>
> > > > > On Jan 29, 10:15 pm, achipa <attila.cs...@gmail.com> wrote:
>
> > > > > > I usually just set a constant in a models/conf.py (along with DB and
> > > > > > other params which vary on the development and the deployment setup)
> > > > > > and check for that.
>
> > > > > > On Jan 28, 1:23 pm, rctay <rcta...@gmail.com> wrote:
>
> > > > > > > Hi,
>
> > > > > > > what do you guys think of providing a global variable (at 
> > > > > > > application-
> > > > > > > level), say, WEB2PY_APP_IS_DEVELOPING?
>
> > > > > > > it would be useful for applications yet to enter production, so 
> > > > > > > that
> > > > > > > one could enable various functionality/code that would be useful 
> > > > > > > for
> > > > > > > developing applications.
>
> > > > > > > eg.
> > > > > > > if (WEB2PY_APP_IS_DEVELOPING):
> > > > > > >   reload(module)
>
> > > > > > > you could control this with a command-line option like --
> > > > > > > developingapps app1,app2,...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to