read tg.config

14 views
Skip to first unread message

Luca Verardi

unread,
May 14, 2013, 10:50:13 AM5/14/13
to turbo...@googlegroups.com
Hi,
I have a var in a .ini file, but i can't find it inside  model/__init__.py
why?
thanks for your answer.

Alessandro Molina

unread,
May 14, 2013, 11:08:18 AM5/14/13
to TurboGears .
When the .ini file is read the application has been already loaded.
So whenever you try to access a configuration option at import time it won't be available because your python package is imported before loading the configuration options.

You should make access to configuration options lazy through something which is resolved after having loaded the configuration file.




--
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email to turbogears+...@googlegroups.com.
To post to this group, send email to turbo...@googlegroups.com.
Visit this group at http://groups.google.com/group/turbogears?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages