from flask import render_template,request,redirect,url_for
from . import main
from ..request import get_sources,get_articles


#Views
@main.route("/")
def index():
    """
    View root page function that returns the index page and its data
    """
    #Getting source
    sources = get_sources()
    print(sources)
    return render_template('index.html', sources = sources)

@main.route('/article/<id>')
def articles(id):
    """
    View Articles page function that returns the source details page and its data
    """
    articles = get_articles(id)
    print(articles)


    return render_template('article.html', id = id,articles= articles)

7c6a6d47fefdbcd52383b5b689837f2a3982a5cb
<mask token>

<mask token>


@main.route('/')
def index():
    """
    View root page function that returns the index page and its data
    """
    sources = get_sources()
    print(sources)
    return render_template('index.html', sources=sources)


<mask token>

<mask token>


@main.route('/')
def index():
    """
    View root page function that returns the index page and its data
    """
    sources = get_sources()
    print(sources)
    return render_template('index.html', sources=sources)


@main.route('/article/<id>')
def articles(id):
    """
    View Articles page function that returns the source details page and its data
    """
    articles = get_articles(id)
    print(articles)
    return render_template('article.html', id=id, articles=articles)

from flask import render_template, request, redirect, url_for
from . import main
from ..request import get_sources, get_articles


@main.route('/')
def index():
    """
    View root page function that returns the index page and its data
    """
    sources = get_sources()
    print(sources)
    return render_template('index.html', sources=sources)


@main.route('/article/<id>')
def articles(id):
    """
    View Articles page function that returns the source details page and its data
    """
    articles = get_articles(id)
    print(articles)
    return render_template('article.html', id=id, articles=articles)

from flask import render_template,request,redirect,url_for
from . import main
from ..request import get_sources,get_articles


#Views
@main.route("/")
def index():
    """
    View root page function that returns the index page and its data
    """
    #Getting source
    sources = get_sources()
    print(sources)
    return render_template('index.html', sources = sources)

@main.route('/article/<id>')
def articles(id):
    """
    View Articles page function that returns the source details page and its data
    """
    articles = get_articles(id)
    print(articles)


    return render_template('article.html', id = id,articles= articles)
