-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathmain.py
32 lines (25 loc) · 1.01 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
############################################################################
## Django ORM Standalone Python Template
############################################################################
""" Here we'll import the parts of Django we need. It's recommended to leave
these settings as is, and skip to START OF APPLICATION section below """
# Turn off bytecode generation
import sys
sys.dont_write_bytecode = True
# Import settings
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')
# setup django environment
import django
django.setup()
# Import your models for use in your script
from db.models import *
############################################################################
## START OF APPLICATION
############################################################################
""" Replace the code below with your own """
# Seed a few users in the database
User.objects.create(name='Dan')
User.objects.create(name='Robert')
for u in User.objects.all():
print(f'ID: {u.id} \tUsername: {u.name}')