lfalanga
3/6/2013 - 7:46 PM

Prevent from seting DJANGO_SETTINGS_MODULE each time.

import sys, os

sys.path.append('/path/to/your/project') # The directory that contains settings.py

# Set up the Django settings/environment
from django.core.management import setup_environ
from myproject import settings

setup_environ(settings)