def export_db():
    """Exports the database."""
    db_engine = DATABASES['default']['ENGINE']
    db_user = DATABASES['default']['USER']
    db_name = DATABASES['default']['NAME']
    db_password = DATABASES['default']['PASSWORD']
    if 'sqlite' in db_engine:
        print('You are using sqlite3, no need to export anything.')
    if 'postgre' in db_engine:
        local('pg_dump -c -U {0} > {1}_psql.sql'.format(db_user, db_name))
    if 'mysql' in db_engine:
        local('mysqldump -u{0} -p {1} {2} > {2}_mysql.sql'.format(db_user,
            db_password, db_name))
dataset/ETHPy150Open bitmazk/webfaction-django-boilerplate/website/webapps/django/project/fabfile/local.py/export_db/original