def handle(self, *args, **options):
print ">>> Initializing your database"
try:
management.call_command('syncdb')
management.call_command('migrate')
try:
# do we need cache table?
cache.get('', None)
except ProgrammingError:
# yes we do
management.call_command('createcachetable', 'vaultier_cache')
# public static files
management.call_command('collectstatic', interactive=False)
except OperationalError as e:
msg = ">>> Your DB is not configured correctly: {}"
print msg.format(e.message)
else:
if options.get('no_statistics'):
task_statistics_collector.delay()
print (">>> DB is initialized, you can now try to run Vaultier "
"using 'vaultier runserver'")
评论列表
文章目录