Re: [pylons-discuss] Cornice: define CORS policy in configuration?

2018-01-08 Thread Laurent DAVERIO
Hi Jens, if you want to define the value in INI files, it will need to be read in a function where either "config" or "settings" is available. One way to do that would be to define CORS_POLICY as a global variable in your app and initialize it using a config.include() call in your __init__.py.

[pylons-discuss] Cornice: define CORS policy in configuration?

2018-01-08 Thread Jens W. Klein
I have a small application where I want to configure `cors_origins` different dependent on the server its running on (dev/ staging/ live) without allowing access cross those domains. At the moment I have a policy defined in Python in a base.py, import it and use it in my classes with the enpoint