电脑开 jupyter notebook 当 ftp 服务器给手机下载文件,手机连入同一局域网,可以打开 jupyter notebook 的页面、选择文件、点 Download,但是手机浏览器一点下载一下就下完,下载页显示下载失败,jupyter notebook 报错显示:
[W 19:31:01.617 NotebookApp] Blocking request with no referer
[W 19:31:01.617 NotebookApp] 403 GET /files/dukto6-5-5.apk?download=1 (10.21.8.176): Blocking request from unknown origin
[W 19:31:01.626 NotebookApp] 403 GET /files/dukto6-5-5.apk?download=1 (10.21.8.176) 9.000000ms referer=None
参考 [1],在 C:/Users/iTom/.jupyter/jupyter_notebook_config.py 中修改配置:
c.NotebookApp.allow_origin = '*'
c.NotebookApp.allow_remote_access = True
改完之后重启 jupyter notebook 手机就下载成功了。
可能还有一个相关的设置项是:
c.NotebookApp.ip = '*'
但这个我是之前就已经设置过了的,不知道影不影响这里。
References
- JupyterLab 3.0.16: Exporting HTML results on “Blocking request with no referer” and “403 Blocking request from unknown origin”
|