def METHOD_NAME(domain, app, langs, version=None, include_multimedia=False, request=False):
    if not app.copy_of:
        errors = app.validate_app()
    else:
        errors = None
    if errors:
        error_html = render_to_string("app_manager/partials/build_errors.html", {
            'app': app,
            'build_errors': errors,
            'domain': domain,
            'langs': langs,
            'toggles': toggles_enabled_for_request(request),
        })
        return JsonResponse(
            {'error_html': error_html},
            status=400,
        )
    app.set_media_versions()
    download = FileDownload('application-{}-{}'.format(app.get_id, version))
    try:
        create_files_for_ccz(
            build=app,
            build_profile_id=None,
            include_multimedia_files=include_multimedia,
            download_id=download.download_id,
            compress_zip=True,
            filename='{}.ccz'.format(slugify(app.name)),
        )
    except Exception as e:
        return JsonResponse({'status': 'error', 'message': str(e)}, status=400)
    return FileDownload.get(download.download_id).toHttpResponse()