Esempio n. 1
0
def home(request):
    template = loader.get_template('controller/index.html')
    count = Visits.incrementVisitCount('index')
    context = Context({
            'views':count
            })
    return HttpResponse(template.render(context))
Esempio n. 2
0
def test(request):
    from datetime import datetime
    
    viewcount = Visits.incrementVisitCount('test')

    Date = str(datetime.now())
    template = loader.get_template('controller/test.psp')
    context = Context({
            'Date':Date,
            'viewCount':viewcount
            })
    return HttpResponse(template.render(context))
Esempio n. 3
0
def page(request):
    #    import pudb; pudb.set_trace()
    path = request.path[1:]
    count = Visits.incrementVisitCount('%s' % path[1:])
    template = loader.get_template('controller/%s' % path)
    
    context = Context({
            'views':count,
            'hasname': 0
            })
    if request.GET.get("firstname"):
        context['firstname'] = request.GET.get("firstname")
        context['lastname'] = request.GET.get("lastname")
        context['hasname'] =  1

    return HttpResponse(template.render(context))