config file - configuration per environment

128 views
Skip to first unread message

Alex

unread,
Mar 17, 2012, 8:26:49 PM3/17/12
to web2py-users
Hi,

what is the best way to have settings depending on the environment? I
know this question has been asked a couple of times before but I could
not find any useful answers.

I want to run multiple instances of my application for multiple
customers, which also means a different db connection for each
instance. I did not see an (elegant) solution in web2py for this
problem. I do not want to create a new package for each instance which
would be really annoying to do for each deployment. Currently I'm
passing the db settings as environment variables. For me this feels
more like a hack but at least it worked - so far. Now I want to run
cron jobs with external cron. This is a problem because I can't pass
the environment settings (which I would have to hard code a second
time anyway), so I can't access the db in the cron job tasks.

It would really be great if web2py had some config settings like in
most other frameworks.

Bruno Rocha

unread,
Mar 17, 2012, 10:09:12 PM3/17/12
to web...@googlegroups.com

Mult tenance, in web2py you have request.tenant

I use SQLite for configs

http://zerp.ly/rochacbruno

Alex

unread,
Mar 18, 2012, 9:51:35 AM3/18/12
to web2py-users
sorry, I don't understand your answer. What does mult tenance mean?
There is no description for tenant in the request documentation. When
I access request.tenant in my local app it is None.

On 18 Mrz., 03:09, Bruno Rocha <rochacbr...@gmail.com> wrote:
> Mult tenance, in web2py you have request.tenant
>
> I use SQLite for configs
>
> http://zerp.ly/rochacbruno

Johann Spies

unread,
Mar 19, 2012, 3:02:05 AM3/19/12
to web...@googlegroups.com
On 18 March 2012 15:51, Alex <mrau...@gmail.com> wrote:
sorry, I don't understand your answer. What does mult tenance mean?
There is no description for tenant in the request documentation. When
I access request.tenant in my local app it is None.

There is something in the book (http://www.web2py.com/books/default/chapter/29/6?search=tenant)
but I must admit that it is not quite clear to me from that documentation how to use it.

Look for the heading

Common fields and multi-tenancy 

in the book.

Regards
Johann
--
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

Reply all
Reply to author
Forward
0 new messages