def cleardb(force=False):
<EOL>if db_exists():<EOL><INDENT>try:<EOL><INDENT>dropdb(force)<EOL><DEDENT>except subprocess.CalledProcessError as error:<EOL><INDENT>output = error.output.decode("<STR_LIT:utf-8>")<EOL>if "<STR_LIT>" in output:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(output)<EOL>)<EOL><DEDENT>else:<EOL><INDENT>raise<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>logger.info(<EOL>"<STR_LIT>", repr(DB["<STR_LIT>"])<EOL>)<EOL><DEDENT>createdb()<EOL>
Drop and create DATABASES['default']