#NEWLINE# def restore( archive ) : #NEWLINE# #INDENT# kwargs = local_settings . DATABASES [ 'default' ] #NEWLINE# kwargs [ 'archive' ] = archive #NEWLINE# kwargs [ 'sql_dump' ] = archive . replace ( '.gz' , '' ) #NEWLINE# local ( 'gzip -cd {archive} > {sql_dump}' . format ( ** kwargs ) ) #NEWLINE# with prefix ( ( 'export PGPASSWORD=%s' % kwargs [ 'PASSWORD' ] ) ) : #NEWLINE# #INDENT# local ( 'psql -h {HOST} -U {USER} {NAME} < {sql_dump}' . format ( ** kwargs ) )