previously I have struggled to debug my app when running Python app directly; I need it to run on my Jupyter Workspace easily to debug
this setup successfully load my Django app
create django_initializer.py base project
import sys, os, django
# Find the project base directory
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, BASE_DIR)
# The DJANGO_SETTINGS_MODULE has to be set to allow us to access django imports
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "www.settings")
# Allow queryset filtering asynchronously when running in a Jupyter notebook
os.environ["DJANGO_ALLOW_ASYNC_UNSAFE"] = "true"
# This is for setting up django
django.setup()
then load from jupyter notebook
import django_initializer
from slackevents.models import SnoozeIncidentsReminder
snoozes = SnoozeIncidentsReminder.objects.all()