Пример #1
0
def handler(req, precon_id=None):
    print("handling %s ,method %s" %(req.path_info, req.method))
    if(req.method == 'POST'):
        return persist(req)
            
    template = loader.get_template('ext.html')
    #ctx = gf_template.get_context(req, {})
    
    ctx = RequestContext(req, {})
    ctx.node_url= settings.NODE_URL or 'http://localhost:3000'
    
    ctx.mvc = True if req.META['HTTP_HOST'].find('mvc')>=0 else False
    
    return HttpResponse(template.render(ctx))
Пример #2
0
def handler(req, precon_id=None):
    print("handling %s ,method %s" % (req.path_info, req.method))
    if (req.method == 'POST'):
        return persist(req)

    template = loader.get_template('ext.html')
    #ctx = gf_template.get_context(req, {})

    ctx = RequestContext(req, {})
    ctx.node_url = settings.NODE_URL or 'http://localhost:3000'

    ctx.mvc = True if req.META['HTTP_HOST'].find('mvc') >= 0 else False

    return HttpResponse(template.render(ctx))