首页 > 代码库 > django-orm-standalone

django-orm-standalone

django-orm-standalone script

via:https://github.com/masnun/django-orm-standalone/

 

# Django specific settingsimport osos.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")# Ensure settings are readfrom django.core.wsgi import get_wsgi_applicationapplication = get_wsgi_application()# Your application specific importsfrom data.models import *#Add useruser = User(name="masnun", email="masnun@gmail.com")user.save()# Application logicfirst_user = User.objects.all()[0]print(first_user.name)print(first_user.email)

 

django-orm-standalone