On Thursday, May 24, 2012 2:22:50 PM UTC-4, Cliff Kachinske wrote: > > If your development environment is Linux, you can set and read an > environment variable to take care of this. > > As sudo or su, add the following line to /etc/environment: > W2PYENV="dev" > > Python only loads the environment once, so I had to kill all the python > instances. I just rebooted. >
ouch. Python doesn't load the environment ever, Linux does, and /etc/environment is just the initial environment. While you could do it the way you suggested, you can avoid reboots and modifying /etc/environment (which affects every user and process in the system, but is not read often); just add it to the command line of your script that starts web2py, e.g. (if using bash) #!/bin/sh W2PYENV="dev" web2py.py -i 0.0.0.0 -a<recycle> -p 80 or #!/bin/sh export W2PYENV="dev" web2py.py -i 0.0.0.0 -a<recycle> -p 80 (or, if using csh/tcsh) #!/bin/tcsh setenv W2PYENV="dev" web2py.py ....