Created
August 15, 2016 05:13
-
-
Save alexhrescale/22861f1ea17c4601ece241881597c08b to your computer and use it in GitHub Desktop.
how to set up your own script, bypassing the manage.py dance
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
from __future__ import unicode_literals | |
import os, sys, django | |
from theproject import settings | |
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'theproject.settings') | |
django.setup() | |
# now import normally, e.g. | |
from django.core.management.base import BaseCommand | |
# ... whatever else |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment