GithubHelp home page GithubHelp logo

django-ipy-nbmgr's Introduction

DEPRECATED

This effort is now deprecated. See benjie/ipython for other efforts on sorting, searching, tagging in the notebook interface.

Old documentation appears below.


Alternative Django based iPython notebook manager: saves notebooks to database, and archive old revisions.

To use, following these steps.

  1. You need to use a development branch of iPython:

You can install this like

pip install -e git://github.com/benjiec/ipython.git@ginkgo#egg=IPython

or just checkout

git clone git://github.com/benjiec/ipython.git
cd ipython
git checkout ginkgo
python setup.py install
  1. Install djnbmgr (this module)
git clone git://github.com/benjiec/django-ipy-nbmgr
cd django-ipy-nbmgr
python setup.py install
  1. Configure your Django app to include "djnbmgr" in INSTALLED_APPS, and add djnbmgr.urls to your URLs. E.g.
urlpatterns = patterns('',
    ...
    url(r'^djnbmgr/', include('djnbmgr.urls')),
    ...
)

Remember to run

python manage.py syncdb djnbmgr
  1. In a directory where you want to run iPython notebook server, create a loader.py file:
from django.conf import settings
settings.configure(
  DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', # or whatever your favorite db is
                             'NAME': '...',
                             'USER': '...',
                             'PASSWORD': '...'
                           }},
  TIME_ZONE = 'America/New_York',
)
from djnbmgr.manager import DjangoNotebookManager
  1. You can start iPython in that directory like this
PYTHONPATH=. ipython notebook --nbmgr loader --ip 0.0.0.0 --pylab inline --NotebookApp.notebook_manager_class=loader.DjangoNotebookManager
  1. Start your Django app. You can visit the admin interface to see notebooks from the admin.

  2. Enable javascript view of the notebooks. Create a HTML page that includes djnbmgr JS files. E.g. assuming in your Django setting, static files are in /static/djnbmgr and your djnbmgr URLs are mapped to /djnbmgr

<html>
  <head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Language" content="en-us" />
    <!-- CSS -->
    <link href="/static/djnbmgr/css/djnbmgr.css" rel="stylesheet" type="text/css" media="screen" />
  </head>
  <body>
    <div id="main">
    </div>
    <!-- djnbmgr JS -->
    <script src="/static/djnbmgr/js/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="/static/djnbmgr/js/handlebars-1.0.0.beta.6.js" type="text/javascript"></script>
    <script src="/static/djnbmgr/js/handlebars-templates.js" type="text/javascript"></script>
    <script src="/static/djnbmgr/js/djnbmgr.js" type="text/javascript"></script>
    <script>
      jQuery(document).ready(function() {
        window.DjangoNotebookManager(jQuery('#main'),'/djnbmgr/api/','url to your ipython server');
      })
    </script>
  </body>
</html>

There is an example HTML file in djnbmgr/static/djnbmgr/example_ui.html

  1. Load that HTML file in the browser, and off you go. For example, the example_ui.html can be loaded with
http://your-server/static/djnbmgr/example_ui.html

Of course the example_ui.html file supplied does not have the correct URL to your ipython server and the base URL for your djnbmgr API.

You can also use iPython notebook server as usual, but your notebooks are stored in the database.

django-ipy-nbmgr's People

Contributors

benjiec avatar

Stargazers

Kevin Hatfield avatar Andreas Trawoeger avatar Adrian Heilbut avatar

Watchers

M Bussonnier avatar James Cloos avatar  avatar

Forkers

cloudxtreme

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.