标签:bms == mode imp mod default rom env pre
import os
if __name__ == ‘__main__‘:
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "BMS.settings") --->manage.py里面找
import django
django.setup()
from app01 import models
books = models.Book.objects.all()
print(books)
标签:bms == mode imp mod default rom env pre
原文地址:https://www.cnblogs.com/ajaxa/p/10371595.html