-
Notifications
You must be signed in to change notification settings - Fork 1
/
seed_db.py
89 lines (79 loc) · 4.21 KB
/
seed_db.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import os
site = Site.objects.first()
site.name = 'localhost'
site.domain = 'localhost:8000'
site.save()
user = User.objects.create_superuser(
email='[email protected]',
password='password')
azure_subscription_id = '6186e102-1a4f-458d-a6bb-b64fd7205cbf'
azure_management_certificate = """-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDsfzpSRZpppROz
ryoREPcGKq5v49x294QmNPTC3sX3STiGhJ9oVbHm2dZrHMdZrjsZ2wuiMc5Jm34r
qFCI8r6OypzD49ndU7endqUFb50vaGMJCdyArzgcu0fpCXOSynz19C++DUozJhvV
DVrCz9SzqDMiQmiEgJ9MX49f38tVUE1fm/VSFnzxCcD5Ssndao1Brr1BdrIVArAk
hZbAfLkm+LARC5hGNKbRyFq1CmtqLXbvpZzsEWq9fj8pAduOOAIB7DtNvnLmWmT/
KAU6vMyPQeyrrn0EDkh/qCziSwWLAekthXB+kGPjlP7S2mx9vmBhQmayCE27u/+6
Ejm6O8CjAgMBAAECggEAXTBE6uZCUh6aBNOg39ivfd6TncNLvBUMHYIAcEkX+LkB
bQAVUCd0UmLD+rD8XHorD6UgkGjPwHFk5g8MrOn57Iop+4Zs8qlqVLKLk/jHF0cq
vwUDvjFNCwVA8LKot87SLphpt5nFAyKhFPKOMPVz+tbsTzObu5pzKsT82ep1VMft
qCCpWnDcD8fGTCxuEdknQnTA2urSNYTGC/XmQGP45RomvnYd64LckypNaNqA23cf
Vs0Qjlb/cV9WKntfXXjMHKLmSA27gECDGdlXLxmj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uYXA9wsoqVzPL+hcLK/PG5m5IRICorv7FEHYLdYU96OKVtojSq
iA==
-----END CERTIFICATE-----"""
AzureProviderConfiguration.create_account(
user=None,
subscription_id=azure_subscription_id,
management_certificate=azure_management_certificate,
location='South Central US')
AzureProviderConfiguration.create_account(
user=user,
subscription_id=azure_subscription_id,
management_certificate=azure_management_certificate,
location='South Central US')
AWSProviderConfiguration.create_providers()
aws_access_key_id = os.environ['AWS_ACCESS_KEY_ID']
aws_secret_access_key = os.environ['AWS_SECRET_ACCESS_KEY']
AWSProviderConfiguration.create_regions(
user=None,
access_key_id=aws_access_key_id,
secret_access_key=aws_secret_access_key)
AWSProviderConfiguration.create_regions(
user=user,
access_key_id=aws_access_key_id,
secret_access_key=aws_secret_access_key)