import os
import django
import sys
import traceback

try:
    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'plp_backend.settings')
    django.setup()

    from core.models import Member
    from core.serializers import MemberSerializer
    import json

    members = Member.objects.all()
    print("Found members count:", members.count())
    data = MemberSerializer(members, many=True).data
    print(json.dumps(data, indent=2))
except Exception as e:
    traceback.print_exc()
