<s> from django . core . management . base import NoArgsCommand <EOL> from django . http import HttpRequest <EOL> from django . core . files . storage import default_storage <EOL> from django . core . files . base import ContentFile <EOL> from laws . views import VoteCsvView <EOL> class Command ( NoArgsCommand ) : <EOL> help = "<STR_LIT>" <EOL> def handle_noargs ( self , ** options ) : <EOL> viewObj = VoteCsvView ( ) <EOL> viewReq = HttpRequest ( ) <EOL> viewRes = viewObj . dispatch ( viewReq ) <EOL> outputFile = ContentFile ( viewRes . content ) <EOL> filewithpath = VoteCsvView . filename <EOL> if default_storage . exists ( filewithpath ) : <EOL> default_storage . delete ( filewithpath ) <EOL> default_storage . save ( filewithpath , outputFile ) </s>
