Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

prequest - override ini settings?

18 views
Skip to first unread message

Jonathan Vanasco

unread,
Mar 25, 2025, 12:43:53 PMMar 25
to pylons-discuss
Does anyone know where/if it's possible to override ini settings with prequest?

Use-case:  I want to ensure the debugtoolbar is disabled for prequest, even if the .ini enables it.

Jonathan Vanasco

unread,
Mar 25, 2025, 12:47:42 PMMar 25
to pylons-discuss
I think i may just re-implement the `bin/prequest` file to do what i need, but if there is another solution i am open!

tonthon

unread,
Mar 25, 2025, 12:56:44 PMMar 25
to pylons-...@googlegroups.com
I know it's not what you asked for but for programmatic customization, I generally move pyramid includes or settings based configuration to the python code.

This way it's easier for example to customize the app initialization process with env vars.
--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pylons-discuss/886b184b-344b-437f-917e-2645a4d416ean%40googlegroups.com.


Jonathan Vanasco

unread,
Mar 25, 2025, 1:47:32 PMMar 25
to pylons-discuss
I like to do that too.

In this case, I am trying to offer a simplified commandline tool to support a handful of operations, which is aimed at novice users of a package.  The debugtoolbar is creating some issues, so I want to turn it off.  I invoke this project a few other ways, and can disable the toolbar or adjust settings in the other contexts -- but prequest isn't friendly to this.

It looks like the only way to handle this is wrapping prequest with another script, and copying/sanitizing the .ini configuration.

Mike Orr

unread,
Mar 25, 2025, 1:47:58 PMMar 25
to pylons-...@googlegroups.com
That kind of thing is where I put code in my main() function
initialization to let environment variables override settings.
'APPNAME__debugtoolbar__enable=1' gets converted to
settings['debugtoolbar.enable]' = '1'. I used double underscores
because periods aren't allowed in ennvar names, some settings have
single underscores in their name,

On Tue, Mar 25, 2025 at 9:44 AM Jonathan Vanasco <jvan...@gmail.com> wrote:
>
> Does anyone know where/if it's possible to override ini settings with prequest?
>
> Use-case: I want to ensure the debugtoolbar is disabled for prequest, even if the .ini enables it.
>
> --
> You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/pylons-discuss/a8d0822a-f2a2-4afe-8299-b0609ecb2091n%40googlegroups.com.



--
Mike Orr <slugg...@gmail.com>

Jonathan Vanasco

unread,
Mar 25, 2025, 2:09:15 PMMar 25
to pylons-discuss

> That kind of thing is where I put code in my main() function
initialization to let environment variables override settings.

Maybe I can do something like that. The issue is that I'm trying to guard against a novice user enabling things they shouldn't.  

Perhaps I can just catch this in main and raise an exception.
Reply all
Reply to author
Forward
0 new messages