How to access Pylons config from a repoze.who authenticator

194 views Asked by At

I'm trying to access the Pylons configuration from inside a repoze.who "authenticator".. I'm using from pylons import config, but it looks like it returns a configuration with default values, not the ones from production.ini.. What am I missing?

2

There are 2 answers

0
Joril On BEST ANSWER

Found a thread that suggests two options:

  1. Passing the config directly to the authenticator instance during middleware setup
  2. Adding a pylons.config.update(config) at the bottom of load_environment
1
estin On

You must using pylons.config after calling load_environment(global_conf, app_conf) in config/middleware.py or use direct app_conf