1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
import sys import os
pwd = os.path.dirname(os.path.realpath(__file__))
sys.path.append(pwd+"../") os.environ.setdefault("DJANGO_SETTINGS_MODULE", "项目名称.settings")
import django django.setup()
from models import model类
model类.objects.all() user = model() user.username = 'zhangsir' user.password = '123456' user.save()
|
近期评论