On Jun 3, 8:02 pm, Wyatt Baldwin <[email protected]> wrote:
> On May 28, 6:08 pm, kochhar <[email protected]> wrote:
>
>
>
> > Hi all,
>
> > I have two .ini files for my app a developmemt.ini and a local.ini which
> > overrides some settings in the dev config to use resources local to my 
> > machine.
> > The relevant parts of my app config files are
>
> > --- development.ini
> > [pipeline:main]
> > pipeline = rev-proxy-prefix
> >             some-other-filter
> >             mainapp
>
> > [filter:rev-proxy-prefix]
> > use = egg:PasteDeploy#prefix
> > prefix = /race
> Also, two special section types exist to apply filters to your applications: 
> [filter-app:...] and [pipeline:...]. Both of these sections define 
> applications, and so can be used wherever an application is needed.
> > [filter:some-other-filter]
> > use = egg:race#some_entry_point
> > config_value = true
>
> > [app:mainapp]
> > use = egg:race
> > full_stack = true
> > cache_dir = %(here)s/data
> > beaker.session.key = rase
> > beaker.session.secret = somesecret
> > db.host = dbhost01.example.com
> > db.port = 5072
>
> > --- local.ini
> > [pipeline:main]
> > pipeline = rev-proxy-prefix
> >             some-other-filter
> >             mainapp
>
> > [filter:rev-proxy-prefix]
> > use = egg:PasteDeploy#prefix
> > prefix = /race
>
> > [filter:some-other-filter]
> > use = egg:race#some_entry_point
> > config_value = true
>
> > [app:mainapp]
> > use = config:development.ini#mainapp
> > db.host = localhost
>
> > This gives me what I want, my local mainapp overrides the development 
> > mainapps
> > db.host config. However, the local file is pretty verbose and I have to 
> > manually
> > keep the pipeline and filter sections in sync with the development file.
> > Cumbersome and error prone. In an ideal world I'd like my local.ini to be
>
> > [pipeline:main]
> > pipeline = config:development.ini
>
> > [app:mainapp]
> > use = config:development.ini#mainapp
> > db.host = localhost
>
> > I've tried this syntax with no luck. Paste simply uses the entire config 
> > from
> > development.ini. Maybe I'm missing something. Is this at all possible with 
> > paste
> > deploy? If I can't get the pipeline config from the development file, is it
> > possible to reference filters in other config files?
>
> You can do something like `pipeline = config:base.ini#filter-section
> mainapp`.
>
> I think what you have here doesn't do what you want because it's
> equivalent to `pipeline = config:development.ini#main`, which doesn't
> make sense because the `pipeline = x y z` list is expected to contain
> apps, and a pipeline section isn't an app.

Well, this isn't true. From the PasteDeploy docs:

    Also, two special section types exist to apply filters to your
    applications: [filter-app:...] and [pipeline:...]. Both of these
    sections define applications, and so can be used wherever
    an application is needed.

> Also, I found that with a pipeline, if the last app listed uses the
> config:x.ini syntax, the __file__ attribute of the parsed config is
> that *other* file, which I thought was strange.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to