On Jul13, 3:06pm, Narendran <[email protected]> wrote:
> Hi,
> I have been trying to work without a config file, but it is a little
> difficult to work across multiple (dev, test and prod) envs. I'd like
> to know the solution if this has been already discussed:
> 1. The db configuration in db.py changes in dev, test and prod env.
> 2. App name changes in different env.
> 3. Other global variables that can change in different envs.
>
> --
> Thanks
> Narendran


Your app can change to whatever name, as long as it does not hardcode
its name inside the source code. Tips:
a. Use local_import() for easier import local module without
mentioning self app name.
b. If you use cron, try to avoid defining your job script in absolute
path format.
c. Use URL(r=request, c='static', f='...') to reference your app's
static resource.
d. Use request.application to dynamically find your other resource

Other global variables can be handled by either Massimo's models/0.py,
or Mathieu's db approach. If you use the former, and a version control
system to sync your source code among different environments, make
sure you don't commit one env's models/0.py into repository and then
pollute others.

Reply via email to