我正在试图弄清楚如何配置运行的IPython笔记本服务器的基本URL。因此,而不是默认值:
#request# GET http://localhost:8888/static/tree/js/main.min.js?v=04a28c5e21950738efb217191f08ac33
#request# GET http://localhost:8888/api/terminals?_=1441754529652
#request# GET http://localhost:8888/custom/custom.js?v=20150908160654
#request# GET http://localhost:8888/notebooks/Untitled1.ipynb?kernel_name=python3#
我想配置所有请求,以便通过ipython
,如:
#request# GET http://localhost:8888/ipython/static/tree/js/main.min.js?v=04a28c5e21950738efb217191f08ac33
#request# GET http://localhost:8888/ipython/api/terminals?_=1441754529652
#request# GET http://localhost:8888/ipython/custom/custom.js?v=20150908160654
#request# GET http://localhost:8888/ipython/notebooks/Untitled1.ipynb?kernel_name=python3#
这可能吗?
答案 0 :(得分:5)
要更改从iPython提供的文件的基本网址,请修改ipython_notebook_config.py
目录中的~/.ipython/[profile-name]/
文件。
特别是,假设您的配置文件以行c = get_config()
开头,您需要在配置中添加以下行:
c.NotebookApp.base_project_url = '/ipython/'
c.NotebookApp.base_kernel_url = '/ipython/'
c.NotebookApp.webapp_settings = {'static_url_prefix':'/ipython/static/'}
这样可以使您的项目从http://localhost:8888/ipython/
而不是http://localhost:8888/
投放。
有关详细信息,请参阅this page of the ipython docs。