How to setup Jupyter/IPython notebook for Django?

First install django-extensions:
pip install django-extensions

Add django_extensions to the list of INSTALLED_APPS in settings.py:
Eg:

# Application definition
INSTALLED_APPS = [
    'appointments.apps.AppointmentsConfig',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django_extensions'
]

Run django server like this:

python manage.py shell_plus --notebook

When jupyter notebook starts up, create a new Django Shell-plus notebook:

Source: StackOverflow