rednafi / django-jupyter

Connecting an ipython notebook server to a dockerized Django application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

django-jupyter

Connecting an ipython notebook server to a containerized Django application.

Prerequisites

Make sure you're running the latest version of docker and docker-compose-v2.

Local development

  • Clone the repo.

  • Go to the root directory and run:

    make up
    

    This will spin up the docker containers.

  • Run the migration:

    make migrate
    
  • To access the notebook server go to http://localhost:8895.

  • Create some objects from the notebook:

    notebook

    from polls import models as polls_models
    from datetime import datetime, timezone
    
    for question_text in ("Are you okay?", "Do you wanna go there?"):
        question = polls_models.Question.objects.create(
            question_text=question_text, pub_date=datetime.now(tz=timezone.utc)
        )
        question.choice_set.set(
            polls_models.Choice.objects.create(choice_text=ctext)
            for ctext in ("yes", "no")
        )
  • Inspect the newly created data in http://localhost:8000.

    django

About

Connecting an ipython notebook server to a dockerized Django application

License:MIT License


Languages

Language:Python 70.8%Language:Makefile 14.3%Language:Jupyter Notebook 12.0%Language:Dockerfile 2.9%