-
Notifications
You must be signed in to change notification settings - Fork 0
/
createadmin.py
executable file
·43 lines (34 loc) · 1.22 KB
/
createadmin.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
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env python
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fourbrothers.settings")
import django
django.setup()
from django.contrib.auth.models import User, Group
if User.objects.count() == 0:
fourbros_staff = Group(name="Fourbrothers Staff")
fourbros_staff.save()
keyvan = User.objects.create_user('keyvan', 'kayvanmsh@gmail.com', 'password')
keyvan.first_name = "Keyvan"
keyvan.last_name = "Mosharraf"
keyvan.is_superuser = True
keyvan.is_staff = True
keyvan.save()
keyvan.groups.add(fourbros_staff)
jeff = User.objects.create_user('jeff', 'jeff@superawesome.ca', 'password')
jeff.first_name = "Jeff"
jeff.last_name = "Gingras"
jeff.is_staff = True
jeff.save()
jeff.groups.add(fourbros_staff)
adam = User.objects.create_user('adam', 'adam@fourbrothers.ca', 'password')
adam.first_name = "Adam"
adam.last_name = "Zameret"
adam.is_staff = True
adam.save()
adam.groups.add(fourbros_staff)
technician = User.objects.create_user('techi', 't@hc.com', 'password')
technician.first_name = 'Techi'
technician.last_name = 'Nician'
technician.save()
technician.profile.type = 'technician'
technician.profile.save()