##// END OF EJS Templates
add broad description of 3.0
Min RK -
Show More
@@ -1,284 +1,306 b''
1 ============
1 ============
2 3.x Series
2 3.x Series
3 ============
3 ============
4
4
5
5
6 Release 3.0b1
6 Release 3.0
7 =============
7 ===========
8
9 Feburary, 2014
10
11 This is a really big release. Over 150 contributors, and almost 6000 commits in under a year.
12 Support for languages other than Python is greatly improved,
13 notebook UI has been significantly redesigned,
14 and a lot of improvement has happened in the experimental interactive widgets.
15 The message protocol and document format have both been updated,
16 while maintaining better compatibility with previous versions than prior updates.
17
18 3.x will be the last monolithic release of IPython,
19 as the next release cycle will see the growing project split into its Python-specific and language-agnostic components.
20 Language-agnostic projects (notebook, qtconsole, etc.) will move under the umbrella of the new Project Jupyter name,
21 while Python-specific projects (interactive Python shell, Python kernel, IPython.parallel)
22 will remain under IPython, and be split into a few smaller packages.
23 To reflect this, IPython is in a bit of a transition state.
24 The logo on the notebook is now the Jupyter logo.
25 When installing kernels system-wide, they go in a `jupyter` directory.
26 We are going to do our best to ease this transition for users and developers.
27
28 Big changes are ahead.
29
8
30
9 Using different kernels
31 Using different kernels
10 -----------------------
32 -----------------------
11
33
12 .. image:: ../_images/kernel_selector_screenshot.png
34 .. image:: ../_images/kernel_selector_screenshot.png
13 :alt: Screenshot of 'new' dropdown showing different kernels
35 :alt: Screenshot of 'new' dropdown showing different kernels
14 :align: center
36 :align: center
15
37
16 You can now choose a kernel for a notebook within the user interface, rather
38 You can now choose a kernel for a notebook within the user interface, rather
17 than starting up a separate notebook server for each kernel you want to use. The
39 than starting up a separate notebook server for each kernel you want to use. The
18 syntax highlighting adapts to match the language you're working in.
40 syntax highlighting adapts to match the language you're working in.
19
41
20 Information about the kernel is stored in the notebook file, so when you open a
42 Information about the kernel is stored in the notebook file, so when you open a
21 notebook, it will automatically start the correct kernel.
43 notebook, it will automatically start the correct kernel.
22
44
23 It is also easier to use the Qt console and the terminal console with other
45 It is also easier to use the Qt console and the terminal console with other
24 kernels, using the --kernel flag::
46 kernels, using the --kernel flag::
25
47
26 ipython qtconsole --kernel bash
48 ipython qtconsole --kernel bash
27 ipython console --kernel bash
49 ipython console --kernel bash
28
50
29 # To list available kernels
51 # To list available kernels
30 ipython kernelspec list
52 ipython kernelspec list
31
53
32 Kernel authors should see :ref:`kernelspecs` for how to register their kernels
54 Kernel authors should see :ref:`kernelspecs` for how to register their kernels
33 with IPython so that these mechanisms work.
55 with IPython so that these mechanisms work.
34
56
35 Typing unicode identifiers
57 Typing unicode identifiers
36 --------------------------
58 --------------------------
37
59
38 .. image:: /_images/unicode_completion.png
60 .. image:: /_images/unicode_completion.png
39
61
40 Complex expressions can be much cleaner when written with a wider choice of
62 Complex expressions can be much cleaner when written with a wider choice of
41 characters. Python 3 allows unicode identifiers, and IPython 3 makes it easier
63 characters. Python 3 allows unicode identifiers, and IPython 3 makes it easier
42 to type those, using a feature from Julia. Type a backslash followed by a LaTeX
64 to type those, using a feature from Julia. Type a backslash followed by a LaTeX
43 style short name, such as ``\alpha``. Press tab, and it will turn into Ξ±.
65 style short name, such as ``\alpha``. Press tab, and it will turn into Ξ±.
44
66
45 Other new features
67 Other new features
46 ------------------
68 ------------------
47
69
48 * :class:`~.TextWidget` and :class:`~.TextareaWidget` objects now include a
70 * :class:`~.TextWidget` and :class:`~.TextareaWidget` objects now include a
49 ``placeholder`` attribute, for displaying placeholder text before the
71 ``placeholder`` attribute, for displaying placeholder text before the
50 user has typed anything.
72 user has typed anything.
51
73
52 * The :magic:`load` magic can now find the source for objects in the user namespace.
74 * The :magic:`load` magic can now find the source for objects in the user namespace.
53 To enable searching the namespace, use the ``-n`` option.
75 To enable searching the namespace, use the ``-n`` option.
54
76
55 .. sourcecode:: ipython
77 .. sourcecode:: ipython
56
78
57 In [1]: %load -n my_module.some_function
79 In [1]: %load -n my_module.some_function
58
80
59 * :class:`~.DirectView` objects have a new :meth:`~.DirectView.use_cloudpickle`
81 * :class:`~.DirectView` objects have a new :meth:`~.DirectView.use_cloudpickle`
60 method, which works like ``view.use_dill()``, but causes the ``cloudpickle``
82 method, which works like ``view.use_dill()``, but causes the ``cloudpickle``
61 module from PiCloud's `cloud`__ library to be used rather than dill or the
83 module from PiCloud's `cloud`__ library to be used rather than dill or the
62 builtin pickle module.
84 builtin pickle module.
63
85
64 __ https://pypi.python.org/pypi/cloud
86 __ https://pypi.python.org/pypi/cloud
65
87
66 * Added a .ipynb exporter to nbconvert. It can be used by passing `--to notebook`
88 * Added a .ipynb exporter to nbconvert. It can be used by passing `--to notebook`
67 as a commandline argument to nbconvert.
89 as a commandline argument to nbconvert.
68
90
69 * New nbconvert preprocessor called :class:`~.ClearOutputPreprocessor`. This
91 * New nbconvert preprocessor called :class:`~.ClearOutputPreprocessor`. This
70 clears the output from IPython notebooks.
92 clears the output from IPython notebooks.
71
93
72 * New preprocessor for nbconvert that executes all the code cells in a notebook.
94 * New preprocessor for nbconvert that executes all the code cells in a notebook.
73 To run a notebook and save its output in a new notebook::
95 To run a notebook and save its output in a new notebook::
74
96
75 ipython nbconvert InputNotebook --ExecutePreprocessor.enabled=True --to notebook --output Executed
97 ipython nbconvert InputNotebook --ExecutePreprocessor.enabled=True --to notebook --output Executed
76
98
77 * Consecutive stream (stdout/stderr) output is merged into a single output
99 * Consecutive stream (stdout/stderr) output is merged into a single output
78 in the notebook document.
100 in the notebook document.
79 Previously, all output messages were preserved as separate output fields in the JSON.
101 Previously, all output messages were preserved as separate output fields in the JSON.
80 Now, the same merge is applied to the stored output as the displayed output,
102 Now, the same merge is applied to the stored output as the displayed output,
81 improving document load time for notebooks with many small outputs.
103 improving document load time for notebooks with many small outputs.
82
104
83 * ``NotebookApp.webapp_settings`` is deprecated and replaced with
105 * ``NotebookApp.webapp_settings`` is deprecated and replaced with
84 the more informatively named ``NotebookApp.tornado_settings``.
106 the more informatively named ``NotebookApp.tornado_settings``.
85
107
86 * Using :magic:`timeit` prints warnings if there is atleast a 4x difference in timings
108 * Using :magic:`timeit` prints warnings if there is atleast a 4x difference in timings
87 between the slowest and fastest runs, since this might meant that the multiple
109 between the slowest and fastest runs, since this might meant that the multiple
88 runs are not independent of one another.
110 runs are not independent of one another.
89
111
90 * It's now possible to provide mechanisms to integrate IPython with other event
112 * It's now possible to provide mechanisms to integrate IPython with other event
91 loops, in addition to the ones we already support. This lets you run GUI code
113 loops, in addition to the ones we already support. This lets you run GUI code
92 in IPython with an interactive prompt, and to embed the IPython
114 in IPython with an interactive prompt, and to embed the IPython
93 kernel in GUI applications. See :doc:`/config/eventloops` for details. As part
115 kernel in GUI applications. See :doc:`/config/eventloops` for details. As part
94 of this, the direct ``enable_*`` and ``disable_*`` functions for various GUIs
116 of this, the direct ``enable_*`` and ``disable_*`` functions for various GUIs
95 in :mod:`IPython.lib.inputhook` have been deprecated in favour of
117 in :mod:`IPython.lib.inputhook` have been deprecated in favour of
96 :meth:`~.InputHookManager.enable_gui` and :meth:`~.InputHookManager.disable_gui`.
118 :meth:`~.InputHookManager.enable_gui` and :meth:`~.InputHookManager.disable_gui`.
97
119
98 * A ``ScrollManager`` was added to the notebook. The ``ScrollManager`` controls how the notebook document is scrolled using keyboard. Users can inherit from the ``ScrollManager`` or ``TargetScrollManager`` to customize how their notebook scrolls. The default ``ScrollManager`` is the ``SlideScrollManager``, which tries to scroll to the nearest slide or sub-slide cell.
120 * A ``ScrollManager`` was added to the notebook. The ``ScrollManager`` controls how the notebook document is scrolled using keyboard. Users can inherit from the ``ScrollManager`` or ``TargetScrollManager`` to customize how their notebook scrolls. The default ``ScrollManager`` is the ``SlideScrollManager``, which tries to scroll to the nearest slide or sub-slide cell.
99
121
100 * The function :func:`~IPython.html.widgets.interaction.interact_manual` has been
122 * The function :func:`~IPython.html.widgets.interaction.interact_manual` has been
101 added which behaves similarly to :func:`~IPython.html.widgets.interaction.interact`,
123 added which behaves similarly to :func:`~IPython.html.widgets.interaction.interact`,
102 but adds a button to explicitly run the interacted-with function, rather than
124 but adds a button to explicitly run the interacted-with function, rather than
103 doing it automatically for every change of the parameter widgets. This should
125 doing it automatically for every change of the parameter widgets. This should
104 be useful for long-running functions.
126 be useful for long-running functions.
105
127
106 * The ``%cython`` magic is now part of the Cython module. Use `%load_ext Cython` with a version of Cython >= 0.21 to have access to the magic now.
128 * The ``%cython`` magic is now part of the Cython module. Use `%load_ext Cython` with a version of Cython >= 0.21 to have access to the magic now.
107
129
108 * The Notebook application now offers integrated terminals on Unix platforms,
130 * The Notebook application now offers integrated terminals on Unix platforms,
109 intended for when it is used on a remote server. To enable these, install
131 intended for when it is used on a remote server. To enable these, install
110 the ``terminado`` Python package.
132 the ``terminado`` Python package.
111
133
112 * Setting the default highlighting language for nbconvert with the config option
134 * Setting the default highlighting language for nbconvert with the config option
113 ``NbConvertBase.default_language`` is deprecated. Nbconvert now respects
135 ``NbConvertBase.default_language`` is deprecated. Nbconvert now respects
114 metadata stored in the :ref:`kernel spec <kernelspecs>`.
136 metadata stored in the :ref:`kernel spec <kernelspecs>`.
115
137
116 * IPython can now be configured systemwide, with files in :file:`/etc/ipython`
138 * IPython can now be configured systemwide, with files in :file:`/etc/ipython`
117 or :file:`/usr/local/etc/ipython` on Unix systems,
139 or :file:`/usr/local/etc/ipython` on Unix systems,
118 or :file:`{%PROGRAMDATA%}\\ipython` on Windows.
140 or :file:`{%PROGRAMDATA%}\\ipython` on Windows.
119
141
120 * Added support for configurable user-supplied `Jinja
142 * Added support for configurable user-supplied `Jinja
121 <http://jinja.pocoo.org/>`_ HTML templates for the notebook. Paths to
143 <http://jinja.pocoo.org/>`_ HTML templates for the notebook. Paths to
122 directories containing template files can be specified via
144 directories containing template files can be specified via
123 ``NotebookApp.extra_template_paths``. User-supplied template directories
145 ``NotebookApp.extra_template_paths``. User-supplied template directories
124 searched first by the notebook, making it possible to replace existing
146 searched first by the notebook, making it possible to replace existing
125 templates with your own files.
147 templates with your own files.
126
148
127 For example, to replace the notebook's built-in ``error.html`` with your own,
149 For example, to replace the notebook's built-in ``error.html`` with your own,
128 create a directory like ``/home/my_templates`` and put your override template
150 create a directory like ``/home/my_templates`` and put your override template
129 at ``/home/my_templates/error.html``. To start the notebook with your custom
151 at ``/home/my_templates/error.html``. To start the notebook with your custom
130 error page enabled, you would run::
152 error page enabled, you would run::
131
153
132 ipython notebook '--extra_template_paths=["/home/my_templates/"]'
154 ipython notebook '--extra_template_paths=["/home/my_templates/"]'
133
155
134 It's also possible to override a template while also `inheriting
156 It's also possible to override a template while also `inheriting
135 <http://jinja.pocoo.org/docs/dev/templates/#template-inheritance>`_ from that
157 <http://jinja.pocoo.org/docs/dev/templates/#template-inheritance>`_ from that
136 template, by prepending ``templates/`` to the ``{% extends %}`` target of
158 template, by prepending ``templates/`` to the ``{% extends %}`` target of
137 your child template. This is useful when you only want to override a
159 your child template. This is useful when you only want to override a
138 specific block of a template. For example, to add additional CSS to the
160 specific block of a template. For example, to add additional CSS to the
139 built-in ``error.html``, you might create an override that looks like::
161 built-in ``error.html``, you might create an override that looks like::
140
162
141 {% extends "templates/error.html" %}
163 {% extends "templates/error.html" %}
142
164
143 {% block stylesheet %}
165 {% block stylesheet %}
144 {{super()}}
166 {{super()}}
145 <style type="text/css">
167 <style type="text/css">
146 /* My Awesome CSS */
168 /* My Awesome CSS */
147 </style>
169 </style>
148 {% endblock %}
170 {% endblock %}
149
171
150 * Added a widget persistence API. This allows you to persist your notebooks interactive widgets.
172 * Added a widget persistence API. This allows you to persist your notebooks interactive widgets.
151 Two levels of control are provided:
173 Two levels of control are provided:
152 1. Higher level- ``WidgetManager.set_state_callbacks`` allows you to register callbacks for loading and saving widget state. The callbacks you register are automatically called when necessary.
174 1. Higher level- ``WidgetManager.set_state_callbacks`` allows you to register callbacks for loading and saving widget state. The callbacks you register are automatically called when necessary.
153 2. Lower level- the ``WidgetManager`` Javascript class now has ``get_state`` and ``set_state`` methods that allow you to get and set the state of the widget runtime.
175 2. Lower level- the ``WidgetManager`` Javascript class now has ``get_state`` and ``set_state`` methods that allow you to get and set the state of the widget runtime.
154
176
155 Example code for persisting your widget state to session data::
177 Example code for persisting your widget state to session data::
156
178
157 %%javascript
179 %%javascript
158 require(['widgets/js/manager'], function(manager) {
180 require(['widgets/js/manager'], function(manager) {
159 manager.WidgetManager.set_state_callbacks(function() { // Load
181 manager.WidgetManager.set_state_callbacks(function() { // Load
160 return JSON.parse(sessionStorage.widgets_state || '{}');
182 return JSON.parse(sessionStorage.widgets_state || '{}');
161 }, function(state) { // Save
183 }, function(state) { // Save
162 sessionStorage.widgets_state = JSON.stringify(state);
184 sessionStorage.widgets_state = JSON.stringify(state);
163 });
185 });
164 });
186 });
165
187
166 * Enhanced support for :magic:`env` magic. As before, :magic:`env` with no
188 * Enhanced support for :magic:`env` magic. As before, :magic:`env` with no
167 arguments displays all environment variables and values. Additionally,
189 arguments displays all environment variables and values. Additionally,
168 :magic:`env` can be used to get or set individual environment variables. To
190 :magic:`env` can be used to get or set individual environment variables. To
169 display an individual value, use the `%env var` syntax. To set a value, use
191 display an individual value, use the `%env var` syntax. To set a value, use
170 `env var val` or `env var=val`. Python value expansion using `$` works as usual.
192 `env var val` or `env var=val`. Python value expansion using `$` works as usual.
171
193
172
194
173 Backwards incompatible changes
195 Backwards incompatible changes
174 ------------------------------
196 ------------------------------
175
197
176 * The :ref:`message protocol <messaging>` has been updated from version 4 to version 5.
198 * The :ref:`message protocol <messaging>` has been updated from version 4 to version 5.
177 Adapters are included, so IPython frontends can still talk to kernels that
199 Adapters are included, so IPython frontends can still talk to kernels that
178 implement protocol version 4.
200 implement protocol version 4.
179
201
180 * The :ref:`notebook format <nbformat>` has been updated from version 3 to version 4.
202 * The :ref:`notebook format <nbformat>` has been updated from version 3 to version 4.
181 Read-only support for v4 notebooks has been backported to IPython 2.4.
203 Read-only support for v4 notebooks has been backported to IPython 2.4.
182 Notable changes:
204 Notable changes:
183
205
184 * heading cells are removed in favor or markdown headings
206 * heading cells are removed in favor or markdown headings
185 * notebook outputs and output messages are more consistent with each other
207 * notebook outputs and output messages are more consistent with each other
186 * use :func:`IPython.nbformat.read` and :func:`~IPython.nbformat.write`
208 * use :func:`IPython.nbformat.read` and :func:`~IPython.nbformat.write`
187 to read and write notebook files
209 to read and write notebook files
188 instead of the deprecated :mod:`IPython.nbformat.current` APIs.
210 instead of the deprecated :mod:`IPython.nbformat.current` APIs.
189
211
190 * :func:`IPython.core.oinspect.getsource` call specification has changed:
212 * :func:`IPython.core.oinspect.getsource` call specification has changed:
191
213
192 * `oname` keyword argument has been added for property source formatting
214 * `oname` keyword argument has been added for property source formatting
193 * `is_binary` keyword argument has been dropped, passing ``True`` had
215 * `is_binary` keyword argument has been dropped, passing ``True`` had
194 previously short-circuited the function to return ``None`` unconditionally
216 previously short-circuited the function to return ``None`` unconditionally
195
217
196 * Removed the octavemagic extension: it is now available as ``oct2py.ipython``.
218 * Removed the octavemagic extension: it is now available as ``oct2py.ipython``.
197
219
198 * Creating PDFs with LaTeX no longer uses a post processor.
220 * Creating PDFs with LaTeX no longer uses a post processor.
199 Use `nbconvert --to pdf` instead of `nbconvert --to latex --post pdf`.
221 Use `nbconvert --to pdf` instead of `nbconvert --to latex --post pdf`.
200
222
201 * Used https://github.com/jdfreder/bootstrap2to3 to migrate the Notebook to Bootstrap 3.
223 * Used https://github.com/jdfreder/bootstrap2to3 to migrate the Notebook to Bootstrap 3.
202
224
203 Additional changes:
225 Additional changes:
204
226
205 - Set `.tab-content .row` `0px;` left and right margin (bootstrap default is `-15px;`)
227 - Set `.tab-content .row` `0px;` left and right margin (bootstrap default is `-15px;`)
206 - Removed `height: @btn_mini_height;` from `.list_header>div, .list_item>div` in `tree.less`
228 - Removed `height: @btn_mini_height;` from `.list_header>div, .list_item>div` in `tree.less`
207 - Set `#header` div `margin-bottom: 0px;`
229 - Set `#header` div `margin-bottom: 0px;`
208 - Set `#menus` to `float: left;`
230 - Set `#menus` to `float: left;`
209 - Set `#maintoolbar .navbar-text` to `float: none;`
231 - Set `#maintoolbar .navbar-text` to `float: none;`
210 - Added no-padding convenience class.
232 - Added no-padding convenience class.
211 - Set border of #maintoolbar to 0px
233 - Set border of #maintoolbar to 0px
212
234
213 * Accessing the `container` DOM object when displaying javascript has been
235 * Accessing the `container` DOM object when displaying javascript has been
214 deprecated in IPython 2.0 in favor of accessing `element`. Starting with
236 deprecated in IPython 2.0 in favor of accessing `element`. Starting with
215 IPython 3.0 trying to access `container` will raise an error in browser
237 IPython 3.0 trying to access `container` will raise an error in browser
216 javascript console.
238 javascript console.
217
239
218 * ``IPython.utils.py3compat.open`` was removed: :func:`io.open` provides all
240 * ``IPython.utils.py3compat.open`` was removed: :func:`io.open` provides all
219 the same functionality.
241 the same functionality.
220
242
221 * The NotebookManager and ``/api/notebooks`` service has been replaced by
243 * The NotebookManager and ``/api/notebooks`` service has been replaced by
222 a more generic ContentsManager and ``/api/contents`` service,
244 a more generic ContentsManager and ``/api/contents`` service,
223 which supports all kinds of files.
245 which supports all kinds of files.
224 * The Dashboard now lists all files, not just notebooks and directories.
246 * The Dashboard now lists all files, not just notebooks and directories.
225 * The ``--script`` hook for saving notebooks to Python scripts is removed,
247 * The ``--script`` hook for saving notebooks to Python scripts is removed,
226 use :samp:`ipython nbconvert --to python {notebook}` instead.
248 use :samp:`ipython nbconvert --to python {notebook}` instead.
227
249
228 * The ``rmagic`` extension is deprecated, as it is now part of rpy2. See
250 * The ``rmagic`` extension is deprecated, as it is now part of rpy2. See
229 :mod:`rpy2.ipython.rmagic`.
251 :mod:`rpy2.ipython.rmagic`.
230
252
231 * :meth:`~.KernelManager.start_kernel` and :meth:`~.KernelManager.format_kernel_cmd`
253 * :meth:`~.KernelManager.start_kernel` and :meth:`~.KernelManager.format_kernel_cmd`
232 no longer accept a ``executable`` parameter. Use the kernelspec machinery instead.
254 no longer accept a ``executable`` parameter. Use the kernelspec machinery instead.
233
255
234 * The widget classes have been renamed from `*Widget` to `*`. The old names are
256 * The widget classes have been renamed from `*Widget` to `*`. The old names are
235 still functional, but are deprecated. i.e. `IntSliderWidget` has been renamed
257 still functional, but are deprecated. i.e. `IntSliderWidget` has been renamed
236 to `IntSlider`.
258 to `IntSlider`.
237 * The ContainerWidget was renamed to Box and no longer defaults as a flexible
259 * The ContainerWidget was renamed to Box and no longer defaults as a flexible
238 box in the web browser. A new FlexBox widget was added, which allows you to
260 box in the web browser. A new FlexBox widget was added, which allows you to
239 use the flexible box model.
261 use the flexible box model.
240
262
241 * The notebook now uses a single websocket at `/kernels/<kernel-id>/channels` instead of separate
263 * The notebook now uses a single websocket at `/kernels/<kernel-id>/channels` instead of separate
242 `/kernels/<kernel-id>/{shell|iopub|stdin}` channels. Messages on each channel are identified by a
264 `/kernels/<kernel-id>/{shell|iopub|stdin}` channels. Messages on each channel are identified by a
243 `channel` key in the message dict, for both send and recv.
265 `channel` key in the message dict, for both send and recv.
244
266
245
267
246 Content Security Policy
268 Content Security Policy
247 ```````````````````````
269 ```````````````````````
248
270
249 The Content Security Policy is a web standard for adding a layer of security to
271 The Content Security Policy is a web standard for adding a layer of security to
250 detect and mitigate certain classes of attacks, including Cross Site Scripting
272 detect and mitigate certain classes of attacks, including Cross Site Scripting
251 (XSS) and data injection attacks. This was introduced into the notebook to
273 (XSS) and data injection attacks. This was introduced into the notebook to
252 ensure that the IPython Notebook and its APIs (by default) can only be embedded
274 ensure that the IPython Notebook and its APIs (by default) can only be embedded
253 in an iframe on the same origin.
275 in an iframe on the same origin.
254
276
255 Override ``headers['Content-Security-Policy']`` within your notebook
277 Override ``headers['Content-Security-Policy']`` within your notebook
256 configuration to extend for alternate domains and security settings.::
278 configuration to extend for alternate domains and security settings.::
257
279
258 c.NotebookApp.tornado_settings = {
280 c.NotebookApp.tornado_settings = {
259 'headers': {
281 'headers': {
260 'Content-Security-Policy': "frame-ancestors 'self'"
282 'Content-Security-Policy': "frame-ancestors 'self'"
261 }
283 }
262 }
284 }
263
285
264 Example policies::
286 Example policies::
265
287
266 Content-Security-Policy: default-src 'self' https://*.jupyter.org
288 Content-Security-Policy: default-src 'self' https://*.jupyter.org
267
289
268 Matches embeddings on any subdomain of jupyter.org, so long as they are served
290 Matches embeddings on any subdomain of jupyter.org, so long as they are served
269 over SSL.
291 over SSL.
270
292
271 There is a `report-uri <https://developer.mozilla.org/en-US/docs/Web/Security/CSP/CSP_policy_directives#report-uri>`_ endpoint available for logging CSP violations, located at
293 There is a `report-uri <https://developer.mozilla.org/en-US/docs/Web/Security/CSP/CSP_policy_directives#report-uri>`_ endpoint available for logging CSP violations, located at
272 ``/api/security/csp-report``. To use it, set ``report-uri`` as part of the CSP::
294 ``/api/security/csp-report``. To use it, set ``report-uri`` as part of the CSP::
273
295
274 c.NotebookApp.tornado_settings = {
296 c.NotebookApp.tornado_settings = {
275 'headers': {
297 'headers': {
276 'Content-Security-Policy': "frame-ancestors 'self'; report-uri /api/security/csp-report"
298 'Content-Security-Policy': "frame-ancestors 'self'; report-uri /api/security/csp-report"
277 }
299 }
278 }
300 }
279
301
280 It simply provides the CSP report as a warning in IPython's logs. The default
302 It simply provides the CSP report as a warning in IPython's logs. The default
281 CSP sets this report-uri relative to the ``base_url`` (not shown above).
303 CSP sets this report-uri relative to the ``base_url`` (not shown above).
282
304
283 For a more thorough and accurate guide on Content Security Policies, check out
305 For a more thorough and accurate guide on Content Security Policies, check out
284 `MDN's Using Content Security Policy <https://developer.mozilla.org/en-US/docs/Web/Security/CSP/Using_Content_Security_Policy>`_ for more examples.
306 `MDN's Using Content Security Policy <https://developer.mozilla.org/en-US/docs/Web/Security/CSP/Using_Content_Security_Policy>`_ for more examples.
General Comments 0
You need to be logged in to leave comments. Login now