[IPython-dev] How to get notebook static url prefix from within python?

Matthias BUSSONNIER bussonniermatthias@gmail....
Fri Sep 20 06:44:44 CDT 2013


Le 20 sept. 2013 à 02:14, Stephen Chan a écrit :

>   This seems like it should be easy, but I just don't know the right
> path through the API and I haven't been having much look googling for
> it.
> 
>   In the notebook.html template, Javascript includes are wrapped by
> static_url().
> 
>   If I have code that generates HTML for display in an output cell,
> and I want to include JS files from under the static JS directories.
> It looks like it is in settings.static_url_prefix but don't seem to be
> able to
> 
>   It doesn't show up in the dictionary that get_ipython().config returns.

$('body').data('baseProjectUrl')

?

I would suggest using require.js (http://requirejs.org/) 
That is smart enough to know it's own location so that you can load relative url. 
And also will do all the caching for you if it is needed… help with dependencies… etc

-- 
M

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-dev/attachments/20130920/219a5703/attachment.html 


More information about the IPython-dev mailing list