Redeploying to Render

Hi. Please i need help with something here. Have been on it all day, I created a MULTIPAGE APP DASHBOARD and i have ran it via spyder on Anaconda Navigator. It does seem to work well. But my challenge is deploying it. But it gave me some errors:

dash.exceptions.NoLayoutException: The layout was None at the time that run_server was called. Make sure to set the layout attribute of your application before running the server.

I would also paste my file and index.pyfile for anyone to help me locate where the error might be.


#Required Libraries
import dash
import dash_bootstrap_components as dbc

#Use of one of the dbc themes from bootswatch
external_stylesheets = [dbc.themes.SKETCHY]

# meta_tags are required for the app layout to be mobile responsive
app = dash.Dash(__name__,

#Running the app on the server
server = app.server

if __name__ == '__main__':


from dash import dcc
from dash import html
from dash.dependencies import Input, Output
# In[ ]:

# Connect to main file
from app import app

# Connect to your app pages
from APPS import tc, sm, rc

app.layout = html.Div([
    dcc.Location(id='url', refresh=False),
        dcc.Link('Table Chart ', href='/APPS/tc'),
        dcc.Link('Revenue Across Shopping Malls ', href='/APPS/sm'),
        dcc.Link('Revenue Category ', href='/APPS/rc'),
    ], className="row"),

@app.callback(Output('page-content', 'children'),
              [Input('url', 'pathname')])
def display_page(pathname):
    if pathname == '/APPS/tc':
        return tc.layout
    if pathname == '/APPS/sm':
        return sm.layout
    if pathname == '/APPS/rc':
        return rc.layout
        return "404 Page Error!"

if __name__ == '__main__':