switch to notebook.auth

master
manetta 2 years ago
parent afbe46ef3c
commit 57e1d22163

@ -1,6 +1,6 @@
import os import os
# from IPython.lib import passwd # from IPython.lib import passwd
from hashlib import sha1 from notebook.auth import passwd
from jinja2 import Environment, FileSystemLoader from jinja2 import Environment, FileSystemLoader
from random import shuffle from random import shuffle
from getpass import getpass from getpass import getpass
@ -28,8 +28,7 @@ userdata['servername'] = servername
password = getpass(f"New password: ") password = getpass(f"New password: ")
userdata['password'] = password userdata['password'] = password
# userdata['password_sha1'] = passwd(password) userdata['password_sha1'] = passwd(password)
userdata['password_sha1'] = sha1(password.encode("utf-8")).hexdigest()
with open("jupyter_notebook_config.temp.py", "w") as f: with open("jupyter_notebook_config.temp.py", "w") as f:
print(nbconfig.render(**userdata), file=f) print(nbconfig.render(**userdata), file=f)

Loading…
Cancel
Save