python加载django环境

import os
import sys
ROOT = 'settings.py所在目录'
sys.path.append(ROOT)
from django.core.management import setup_environ
import settings
setup_environ(settings)

  

posted @ 2014-07-21 11:25  to_jh  阅读(109)  评论(0编辑  收藏  举报