def getFile(request):
    fileContent = 'Your name is %s' % request.GET['name']
res = HttpResponse(fileContent)
res['Content-Disposition'] = 'attachment; filename=yourname.txt'
generating a file with django to download with javascript/jQuery