Last active
March 5, 2019 23:14
-
-
Save mbylstra/5893273 to your computer and use it in GitHub Desktop.
Django scratchpad file. A standalone Django script with the django environment loaded.Place in the root of your Django project. Assumes your settings.py is in a folder named 'main'.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
project_dir = os.path.realpath(__file__) | |
sys.path.append(project_dir) | |
os.environ['DJANGO_SETTINGS_MODULE'] = 'main.settings' | |
import django | |
from django.conf import settings | |
django.setup() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment