(request, uid, fname)
return response
Download the raw recipe template as a file
Download the raw recipe template as a file
Download the raw recipe template as a file
def recipe_code_download(request, uid, fname):
    """
    Download the raw recipe template as a file
    """

    recipe = Analysis.objects.filter(uid=uid).first()

    script = auth.render_script(recipe=recipe)

    # Trigger file download with given filename.
    response = HttpResponse(script, content_type='text/plain')
    response['Content-Disposition'] = f'attachment; filename={fname}'

    return response
def recipe_code_download ( request , uid , fname ) : recipe = Analysis . objects . filter ( uid = uid ) . first ( ) script = auth . render_script ( recipe = recipe ) # Trigger file download with given filename. response = HttpResponse ( script , content_type = 'text/plain' ) response [ 'Content-Disposition' ] = f'attachment; filename={fname}' return response