I am trying to access my Django (v1.10) app DB from another python script and having some trouble doing so.
This is my file and folder structure:
sto
Try this
import sys, os, django sys.path.append("/path/to/store") #here store is root folder(means parent). os.environ.setdefault("DJANGO_SETTINGS_MODULE", "store.settings") django.setup() from store_app.models import MyModel
This script you can use anywhere in your system.