标签:main 脚本 setting style bms pre app code 调用
import os if __name__ == ‘__main__‘: os.environ.setdefault("DJANGO_SETTINGS_MODULE", "BMS.settings") import django django.setup() from app01 import models books = models.Book.objects.all() print(books)
标签:main 脚本 setting style bms pre app code 调用
原文地址:https://www.cnblogs.com/xiao-xue-di/p/9773505.html