示例#1
0
文件: views.py 项目: tjworks/precon
def home(req):
    template = loader.get_template('home.html')
    #ctx = gf_template.get_context(req, {})
    ctx = RequestContext(req, {})
    ctx.node_url= settings.NODE_URL or 'http://localhost:3000'
    
    if('debug' in req.GET and req.GET['debug']):
        ctx.debug_info = renderDebugInfo()
    
    return HttpResponse(template.render(ctx))
示例#2
0
def home(req):
    template = loader.get_template('home.html')
    #ctx = gf_template.get_context(req, {})
    ctx = RequestContext(req, {})
    ctx.node_url = settings.NODE_URL or 'http://localhost:3000'

    if ('debug' in req.GET and req.GET['debug']):
        ctx.debug_info = renderDebugInfo()

    return HttpResponse(template.render(ctx))
示例#3
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))
示例#4
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))