Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

env vars in appconfig.ini #1395

Closed
laminko opened this issue Jul 18, 2016 · 3 comments
Closed

env vars in appconfig.ini #1395

laminko opened this issue Jul 18, 2016 · 3 comments

Comments

@laminko
Copy link
Contributor

laminko commented Jul 18, 2016

Environment variables support in appconfig.ini.

Discussion: https://groups.google.com/forum/m/#!topic/web2py/3x_aLR3a5iE

@mdipierro
Copy link
Contributor

Instead of
[db]
uri=%(MY_DB_URL)s

Use

[db]
uri = {MY_DB_URL}

and when you use it:

myconf.get('uri').format(os.environ)

@laminko
Copy link
Contributor Author

laminko commented Aug 14, 2016

Thank you.

@laminko
Copy link
Contributor Author

laminko commented Aug 14, 2016

Hi, @mdipierro .

os.environ should have unpacked notation **. Because I got the error and found the solution in python doc: .format(**dict).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants