-
Notifications
You must be signed in to change notification settings - Fork 61
/
makemigrations.py
44 lines (38 loc) · 1.15 KB
/
makemigrations.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
#!/path/to/your python
import os
import django
from django.conf import settings
from django.core.management import call_command
DJANGO_SETTINGS = {
"SECRET_KEY": "change-me-later",
"DATABASES": {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": os.path.join("", "db.sqlite3"),
}
},
"ROOT_URLCONF": "phone_verify.urls",
"INSTALLED_APPS": [
"django.contrib.auth",
"django.contrib.contenttypes",
"phone_verify",
],
# PHONE VERIFICATION
"PHONE_VERIFICATION": {
"BACKEND": "phone_verify.backends.twilio.TwilioBackend",
"OPTIONS": {
"SID": "fake",
"SECRET": "fake",
"FROM": "+14755292729",
"SANDBOX_TOKEN": "123456",
},
"TOKEN_LENGTH": 6,
"MESSAGE": "Welcome to {app}! Please use security code {security_code} to proceed.",
"APP_NAME": "Phone Verify",
"SECURITY_CODE_EXPIRATION_TIME": 1, # In seconds only
"VERIFY_SECURITY_CODE_ONLY_ONCE": False,
},
}
settings.configure(**DJANGO_SETTINGS)
django.setup()
call_command("makemigrations", "phone_verify")