python脚本在不启动django查看ORM

import os
import sys
import django
#环境变量
sys.path.append(r'C:\Users\Administrator\PycharmProjects\s6day109')

os.chdir(r'C:\Users\Administrator\PycharmProjects\s6day109')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "s6day109.settings")
django.setup()

from crm import models

v = models.Customer.objects.all()
print(v)

你可能感兴趣的:(python脚本在不启动django查看ORM)