I ran into a similar issue overriding the 'url_scheme'. I need to
override it via an environment variable in Docker containers. I ended
up creating a run script that uses 'pyramid.paster' functions, so now
I have separate app and logging INI files, and the server
configuration is handled by the script.

I did find out that 'get_appsettings' requires a 'use=' key, even
though it seems unused if you call the application's main() yourself.
So that's another case where pserve/PasteDeploy assumes a pretty
narrow usage range.

On Mon, Mar 3, 2025 at 7:50 AM Jonathan Vanasco <[email protected]> wrote:
>
> Is there any way to access the configured host/port in the 
> `project/__init__.py::main(global_config, **settings):` block?  Those vars 
> are set in the `[server:main]` block of a `config.ini` file - not 
> `[app:main]`. It looks like I can determine them in the context of a request 
> due to the implementation details of WSGI, but I need to access them in the 
> initial app setup.
>
> It seems like they may not be passed onto Pyramid and I would need to parse 
> the configuration file and pull it out myself.
>
> --
> 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 [email protected].
> To view this discussion visit 
> https://groups.google.com/d/msgid/pylons-discuss/f24eac45-de01-4ed1-812b-1f5d31a85081n%40googlegroups.com.



-- 
Mike Orr <[email protected]>

-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/pylons-discuss/CAH9f%3Duq%2BvEffQNqRChfLv5dk_WZ8rd3TYTxw5vak4ocLeS2eng%40mail.gmail.com.

Reply via email to