def init_django():
# Making Django run this way is a two-step process. First, call
# settings.configure() to give Django settings to work with:
from django.conf import settings
settings.configure(**SETTINGS_DICT)
# Then, call django.setup() to initialize the application cache
# and other bits:
import django
django.setup()
# Originally we defined this as a session-scoped fixture, but that
# broke django.test.SimpleTestCase instances' class setup methods,
# so we need to call this function *really* early.
评论列表
文章目录