@throttle(settings.API_MAX_REQUESTS, settings.API_THROTTLE_INTERVAL)
    @method_decorator(one_perm_required_or_403(pr_project_private_perm,
        (Project, 'slug__exact', 'project_slug')))
    def read(self, request, project_slug, resource_slug=None,
             language_code=None, api_version=1):
        try:
            resource = Resource.objects.get(
                project__slug=project_slug, slug=resource_slug
            )
            language = Language.objects.by_code_or_alias(code=language_code)
        except (Resource.DoesNotExist, Language.DoesNotExist), e:
            return BAD_REQUEST("%s" % e )

        try:
            fb = FormatsBackend(resource, language)
            template = fb.compile_translation(None)
        except Exception, e:
            logger.error(unicode(e), exc_info=True)
            return BAD_REQUEST("Error compiling the translation file: %s" %e )

        response = HttpResponse(
            template, mimetype=registry.mimetypes_for(resource.i18n_method)[0]
        )
        response['Content-Disposition'] = (
            'attachment; filename*="UTF-8\'\'%s_%s%s"' % (
                urllib.quote(resource.name.encode('UTF-8')), language.code,
                registry.file_extension_for(resource, language)
            )
        )

        return response
API Handler to export translation files from the database
dataset/ETHPy150Open rvanlaar/easy-transifex/src/transifex/transifex/resources/api.py/FileHandler.read