Created
April 21, 2017 11:14
-
-
Save mdiener21/8092c2abf633c5c9d021a9184308945d to your computer and use it in GitHub Desktop.
Run Django as a script
This file contains hidden or 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
# add this to top of script with the correct path to your app | |
import sys, os | |
sys.path.append('/path/to/your/django/app') | |
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' | |
from django.conf import settings |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment