-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanage.py
executable file
·29 lines (25 loc) · 978 Bytes
/
manage.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
# -*- coding: utf-8 -*-
if __name__ == '__main__':
from common.appenginepatch.aecmd import setup_env
setup_env(manage_py_env=True)
# Recompile translation files
from mediautils.compilemessages import updatemessages
updatemessages()
# Regenerate media files
import sys
from mediautils.generatemedia import updatemedia, generatemedia
if len(sys.argv) < 2 or sys.argv[1] not in ('generatemedia', 'update'):
updatemedia()
# Generate compressed media files for manage.py update
if len(sys.argv) >= 2 and sys.argv[1] == 'update':
generatemedia(True)
import settings
from django.core.management import execute_manager
try:
execute_manager(settings)
finally:
# Regenerate uncompressed media files after manage.py update
import sys
from mediautils.generatemedia import generatemedia
if len(sys.argv) >= 2 and sys.argv[1] == 'update':
generatemedia(False)