There is no ConfigManager in JupyterHub. That’s strictly for client-side nbextensions in the single-user server.
Once your Authenticator is instantiated, the config is loaded as self.config. That said, you shouldn’t ever need to access the config object directly. Configuration is done through traitlets. Once you have declared the configurable traits with .tag(config=True), you can set them in your config file and instantiation takes care of the rest:
from traitlets import Unicode
from jupyterhub.auth import Authenticator
class MyAuthenticator(Authenticator):
thing = Unicode('default', help='helpful info').tag(config=True)
then in your jupyterhub_config.py, set this value:
c.MyAuthenticator.thing = 'not the default'
-MinRK
--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/44d3543d-816a-4e6a-a9b8-94a06ba5045f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
There is no ConfigManager in JupyterHub. That’s strictly for client-side nbextensions in the single-user server.
Once your Authenticator is instantiated, the config is loaded as
self.config. That said, you shouldn’t ever need to access the config object directly. Configuration is done through traitlets. Once you have declared the configurable traits with.tag(config=True), you can set them in your config file and instantiation takes care of the rest:from traitlets import Unicode from jupyterhub.auth import Authenticator class MyAuthenticator(Authenticator): thing = Unicode('default', help='helpful info').tag(config=True)then in your jupyterhub_config.py, set this value:
c.MyAuthenticator.thing = 'not the default'-MinRK
On Fri, Aug 5, 2016 at 11:41 PM, Ted Liefeld <lie...@broadinstitute.org> wrote:
I have created a custom authenticator and I would like to paramaterize a few bits of it but I am struggling to understand how to get a hold of the populated ConfigManager instance from the Jupyterhub.
I tried adding
from notebook.services.config import ConfigManager
and then
cm = ConfigManager()
print("Config is " , cm.get("JupyterHub"))
thinking this would get me the values for the "JupyterHub" section which I know has entries that are being used. This is always coming back empty though. I figure I need to get the populated instance from the JupyterHub application but I can't quite figure out how to get my hands on it.
I also looked at the OAuth authenticator thinking it did the same thing, but it only ever does things like this
os.getenv('OAUTH_CALLBACK_URL', '')
which is surprising since from the docs it looks like it puts params in the file
--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.