app/main/views.py
def index():
    '''
    View root page function that returns index page and it's data
    '''

    #Getting popular movies
    popular_movies = get_movies('popular')
    upcoming_movie = get_movies('upcoming')
    now_showing_movie = get_movies('now_playing')
    title = "Home - Welcome to the best Movie Review Website Online"
    
    search_movie = request.args.get('movie_query')

    if search_movie:
        return redirect(url_for('search', movie_name=search_movie))
    else:
        return render_template('index.html', title = title, popular = popular_movies, upcoming = upcoming_movie, now_showing = now_showing_movie)

    View root page function that returns index page and it's data
    
View root page function that returns index page and it's data
View root page function that returns index page and it ' s data
def index():
    popular_movies = get_movies('popular')
    upcoming_movie = get_movies('upcoming')
    now_showing_movie = get_movies('now_playing')
    title = "Home - Welcome to the best Movie Review Website Online"
    search_movie = request.args.get('movie_query')
    if search_movie:
        return redirect(url_for('search', movie_name=search_movie))
    else:
        return render_template('index.html', title = title, popular = popular_movies, upcoming = upcoming_movie, now_showing = now_showing_movie)
def index ( ) : popular_movies = get_movies ( 'popular' ) upcoming_movie = get_movies ( 'upcoming' ) now_showing_movie = get_movies ( 'now_playing' ) title = "Home - Welcome to the best Movie Review Website Online" search_movie = request . args . get ( 'movie_query' ) if search_movie : return redirect ( url_for ( 'search' , movie_name = search_movie ) ) else : return render_template ( 'index.html' , title = title , popular = popular_movies , upcoming = upcoming_movie , now_showing = now_showing_movie )
View root page function that returns index page and it's data
View root page function that returns index page and it ' s data
'''
    View root page function that returns index page and it's data
    ''' #Getting popular movies