Connecting an ipython notebook server to a containerized Django application.
Make sure you're running the latest version of docker and docker-compose-v2.
-
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:
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.