-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/page template #79
Feature/page template #79
Conversation
… async function in JupyterHub 1.0
…verage the 'c.JupyterHub.template_paths' configuration
The template path depends on python version and method used to install the nativeauthenticator package, perhaps there is some way we could automate the template inclusion? (I think this needs some change upstream) Otherwise, thanks for this, it is a nice addition to nativeauthenticator. |
Good point! It would be possible to make it independent of the underlying folder structure like this: import os, nativeauthenticator
c.JupyterHub.template_paths = ["{}/templates/".format(os.path.dirname(nativeauthenticator.__file__))] This could be added to the documentation as an optional feature, but I understand if a completely automated solution would be preferred. |
Hi @raethlein ! Thank you for your contribution! I tried both things locally and couldn't make it work. Any idea what I may be doing wrong? |
@leportella I had it working with |
Yeah, this is definitely not ideal. I was wondering if we could automatically load this from inside the code. @yuvipanda do you have any thoughts on this? |
This PR hasn't seen any activity in a while, but I still think it would be lovely to have. |
I decided to merge this PR for the reasons above. I've tested it again today and like I said before, @raethlein's code to automatically find the template files works flawlessly. I have added it to the documentation as well. |
@lambdaTotoro when you mention @raethlein's code to automatically find the templates files, are you referring to this? import os, nativeauthenticator
c.JupyterHub.template_paths = ["{}/templates/".format(os.path.dirname(nativeauthenticator.__file__))] |
That's the one, yes. Should be identical to the one in the docs. |
Add tabs for "Change Password" and "Authorize Users" into the page by using JupyterHub's template extension functionality (see documentation):
To use it, the user has to add the templates folder to the templates path in the JupyterHub configuration file. Example:
c.JupyterHub.template_paths = ["/usr/local/lib/python3.5/dist-packages/nativeauthenticator/templates/"]