@csrf_exempt
@one_perm_required_or_403(
    pr_project_add_change,
    (Project, 'slug__exact', 'project_slug')
)
def get_from_app(request, project_slug, txapp_slug):
    txapp = get_object_or_404(TxApp, slug=txapp_slug)
    project = get_object_or_404(Project, slug=project_slug)

    root_path = _root_namespace(request.path, txapp)
    requested_path = _remove_namespace_from_path(root_path, request.path)
    if not txapp.access_is_allowed(request.user, project, requested_path):
        return HttpResponseForbidden()
    logger.debug(
        "Path requested from tx app %s is %s" % (txapp_slug, requested_path)
    )

    url = '/'.join([txapp.url, project_slug, requested_path])
    try:
        res = _forward_to_app(url, request.method, dict(request.POST.items()))
    except RemoteTxAppError, e:
        return error_contacting_app(request, url, txapp, e)
    if 'next_url' in res:
        path = _add_namespace_to_path(root_path, res['next_url'])
        return HttpResponseRedirect(path)
    template = '\n'.join([
            '{% extends "txapp_base.html" %}',
            '{% block txapp %}',
            res['content'],
            '{% endblock %}',
    ]).replace("\{", "{").replace("\}", "}").replace("\%", "%")
    t = Template(template)
    context = RequestContext(
        request,
        {'txapp_root_url': root_path, 'is_owner': request.user == project.owner}
    )
    return HttpResponse(
        t.render(context)
    )
Get a template string from a tx app.
dataset/ETHPy150Open rvanlaar/easy-transifex/src/transifex/transifex/addons/txapps/views.py/get_from_app