If you access the plaster loader directly you can query the whole file. 
However, if you wait until your pastedeploy app factory then everything is 
hidden from you and you have to parse the file again yourself. The file path is 
contained in the `global_config["__file__"]` key passed to the app factory so 
it is pretty straightforward to do it.

> On Mar 3, 2025, at 08:50, 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] 
> <mailto:[email protected]>.
> To view this discussion visit 
> https://groups.google.com/d/msgid/pylons-discuss/f24eac45-de01-4ed1-812b-1f5d31a85081n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/pylons-discuss/f24eac45-de01-4ed1-812b-1f5d31a85081n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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/748C4348-D217-473F-B44B-9B3B39BAFE33%40gmail.com.

Reply via email to