django-orm-standalone script
via:https://github.com/masnun/django-orm-standalone/
# Django specific settings import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") # Ensure settings are read from django.core.wsgi import get_wsgi_application application = get_wsgi_application() # Your application specific imports from data.models import * #Add user user = User(name="masnun", email="[email protected]") user.save() # Application logic first_user = User.objects.all()[0] print(first_user.name) print(first_user.email)
时间: 2024-11-10 19:36:15