import os
import sys
import django
sys.path.append(r'C:\Users\Administrator\PycharmProjects\your projectname') os.chdir(r'C:\Users\Administrator\PycharmProjects\your projectname')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "your projectname.settings")
django.setup() from crm import models v = models.Customer.objects.all()
print(v)