web_framework: Reduce verbosity of DB migration process

During provisioning of container/VM, we need to run --list-dependencies. When
run without --develop, they are unable to create database. When run with
--develop, the output from the database migration process is messing up the
output meant for stdin as it is outputting to stdout instead stderr. Reduce
verbosity even in debug mode to fix this.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
Sunil Mohan Adapa authored and Veiko Aasa committed 2020-06-04 18:19:36 +03:00
1 parent 848845c432
commit f2d43737fa
1 file changed
+2 -2
+2 -2
View File
@@ -54,9 +54,8 @@ def init():
settings.INSTALLED_APPS)
logger.debug('Creating or adding new tables to data file')
verbosity = 1 if cfg.develop else 0
django.core.management.call_command('migrate', '--fake-initial',
interactive=False, verbosity=verbosity)
interactive=False, verbosity=0)
os.chmod(cfg.store_file, stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP)
# Cleanup expired sessions every day
@@ -98,6 +97,7 @@ def get_languages():
Add additional languages that FreedomBox support but Django doesn't.
"""
def gettext_noop(string):
"""Django's actual translation methods need Django to be setup."""
return string