Esempio n. 1
0
def index(request):
    t = loader.get_template('summary.html')

    fetched_date, articles, errors = jsondb.get_latest_fetched_articles(STATIC_DATA_PATH)

    template_values = {'all_articles':articles}
    template_values.update(base_template.load_sidebar_data(STATIC_DATA_PATH))
    template_values.update(base_template.load_footer_data())
    c = Context(template_values)

    return HttpResponse(t.render(c))
Esempio n. 2
0
def index(request):
    t = loader.get_template('summary.html')

    fetched_date, articles, errors = jsondb.get_latest_fetched_articles(
        STATIC_DATA_PATH)

    template_values = {'all_articles': articles}
    template_values.update(base_template.load_sidebar_data(STATIC_DATA_PATH))
    template_values.update(base_template.load_footer_data())
    c = Context(template_values)

    return HttpResponse(t.render(c))
Esempio n. 3
0
def index(request):
    t = loader.get_template('source_list.html')
    d = {}
    sidebar_data = base_template.load_sidebar_data(STATIC_DATA_PATH)
    d.update(sidebar_data)

    source_stats = jsondb.get_per_source_statistics(STATIC_DATA_PATH)
    d.update({'sources': source_stats})

    overall_stats = jsondb.make_overall_statistics(source_stats)
    d.update(overall_stats)

    d.update(base_template.load_footer_data())

    c = Context(d)

    return HttpResponse(t.render(c))
Esempio n. 4
0
def index(request):
    t = loader.get_template('source_list.html')
    d = {}
    sidebar_data =  base_template.load_sidebar_data(STATIC_DATA_PATH)
    d.update(sidebar_data)

    source_stats = jsondb.get_per_source_statistics(STATIC_DATA_PATH)
    d.update({'sources':source_stats})

    overall_stats = jsondb.make_overall_statistics(source_stats)
    d.update(overall_stats)

    d.update(base_template.load_footer_data())

    c = Context(d)

    return HttpResponse(t.render(c))