我创建了一个新的个人资料,并将其设置为可通过https进行公开访问.如IPython文档中所述.
生成哈希密码:
In [1]: from IPython.lib import passwd
In [2]: passwd()
Enter password:
Verify password:
Out[2]: 'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed'
Run Code Online (Sandbox Code Playgroud)
创建证书:
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem
Run Code Online (Sandbox Code Playgroud)
并创建了一个新的个人资料
ipython profile created publicServer
Run Code Online (Sandbox Code Playgroud)
编辑了〜/ .ipython/profile_publicServer /中的ipython_notebook_config.py文件
c = get_config()
# Kernel config
c.IPKernelApp.pylab = 'inline' # if you want plotting support always
# Notebook config
c.NotebookApp.certfile = u'/absolute/path/to/your/certificate/mycert.pem'
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.password = u'sha1:bcd259ccf...[your hashed password here]'
# It is a good idea to …
Run Code Online (Sandbox Code Playgroud)