I have filled the ticket about that (#2394).
I've testted your advice to pull configuration option from
development.ini from app_cfg.py
I am using TurboGears version 2.0.3:
in development.ini I have:
[app:main]
use = egg:tgsis
full_stack = true
#lang = ru
cache_dir = %(here)s/data
beaker.session.key = tgsis
beaker.session.secret = somesecret
# should paster serve static files
serve_static = True
in app_cfg.py I have:
import tg
base_config.serve_static = tg.config.get('serve_static', False)
When I use it like so, it doesn't serve static files (but even when the
option is set in development.ini to True!)...
In the second case, when I use:
base_config.serve_static = tg.config.get('serve_static', True)
It serves static files, but ... it serves them even if serve_static in
development.ini is set to False.
What am I doing wrong?
Jorge Vargas napsal(a):
> On Fri, Oct 16, 2009 at 8:54 AM, marty <[email protected]> wrote:
>> I am using TurboGears 2...
>>
>> The configuration value "base_config.serve_static" can be set in
>> app_cfg.py file. I would prefere if there was a way to set it in
>> 'development.ini' or 'production.ini'. The reason is, because I
>> consider
>> this option rather deployment specific than application configuration
>> specific.
>>
>> Use case: I am developing my application on my computer and don't want
>> to
>> set up Apache alias for my working 'public' directory (multiple
>> branches, etc...), so I am using paster server. Than I want to my
>> application to production machine,
>> which is set up to have served static files by Apache (for performance
>> reasons).
>>
>> Is there any possibility to map some values from app_cfg.py to
>> development.ini, or production.ini?
>>
> You are right this should be in the .ini files can you please open a
> ticket so we can fix it ?
>
>> Could anyone help, please? Maybe I've missed something in the
>> documentation, but I can't get it right...
>
> In the meantime you can set the value in [app:main] and pull it from the
> app_cfg
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---