use an environmental variable or a configuration file that you'll have in 
private/ but won't commit to git. For the latter solution, the current 
scaffolding uses a new module, named appconfig.

On Monday, April 27, 2015 at 4:40:06 PM UTC+2, hiro wrote:
>
> I connect to an external DB in one of my models:
>
> my_model.db:
>
> my_db = DAL(
>     'postgres://user:password@url/database',
>     pool_size=20,
>     after_connection=lambda self: self.execute('set search_path to 
> my_schema, other_schema, public; set statement_timeout to 60000;'),
>     migrate=False
> )
>
> Now we are planning to adding the project to a git repository and I would 
> now like to store our password there. 
>
> I though about just creating the connection string by reading the .pgpass 
> file. It will probably work but it seems unnecessary to read .pgpass every 
> request. What is the best way to load the password at startup but not all 
> other requests? Maybe just create in if statement?
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to