Skip to content

Instantly share code, notes, and snippets.

@nara-l
Last active June 20, 2018 14:20
Show Gist options
  • Save nara-l/ec707f8fc699ee23b39533c4413c9ea7 to your computer and use it in GitHub Desktop.
Save nara-l/ec707f8fc699ee23b39533c4413c9ea7 to your computer and use it in GitHub Desktop.
Using Django Model in a python standalone script
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE",'project_name.settings') # replace project_name with your project name
import django
django.setup()
from my_app.models import (
Customers,
Organizations,
Personalization,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment