Skip to content

Instantly share code, notes, and snippets.

@aljiwala
Created March 14, 2018 11:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aljiwala/41a2f310cb194593c801fc8f1e95dc07 to your computer and use it in GitHub Desktop.
Save aljiwala/41a2f310cb194593c801fc8f1e95dc07 to your computer and use it in GitHub Desktop.
Django Standalone Script
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment