-
Notifications
You must be signed in to change notification settings - Fork 14
/
deploy.py
35 lines (29 loc) · 910 Bytes
/
deploy.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
#djang0byte deploy script
import os
import sys
sys.path.append(os.getcwd())
if __name__ == '__main__':
deps = open('deps', 'r')
for dep in deps.readlines():
if os.system('pip install %s' % (dep,)): # Returns 0 on success
sys.exit("Unable to install dependency: %s "
"consider logging in as a superuser." % dep)
os.environ["DJANGO_SETTINGS_MODULE"] = "settings"
import settings
from main.models import Profile, BlogType
from django.contrib.auth.models import User
from treemenus.models import Menu
if os.system('python manage.py syncdb'): # Returns 0 on success
sys.exit("Unable to execute syncdb")
Profile.objects.create(
user=User.objects.get()
)
Menu.objects.create(
name='menu'
)
Menu.objects.create(
name='bottom_menu'
)
BlogType.objects.create(
name='main'
)