Black Lives Matter. Please consider donating to Black Girls Code today.

Heroku R10 boot time error

I’m creating an app using Heroku and I’ve been having success deploying the site on a small scale. (I’m only using 5 or so pages in this small scale deploy for testing). I have about 30 different pages as a part of this app. They are all very similar but they have different data and color scheme. The functionality is the same across all of them.

The R10 boot time error issue happens when I try and deploy the app with all 30 pages. My index file is below. When I get the error I am trying to import all files. I believe I get R10 because my app can’t import all 30 pages in 60 seconds. If I wait to the files when they click on each link then the callbacks don’t work unless you refresh the page. That is kind of the method I’m doing in my current index file. However, the app does build and deploy very quickly. What are my options?

import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import dash_bootstrap_components as dbc
from app import app
from app import server
from apps import pitch
from apps import first
from apps import bal
#from apps import nyy
#from apps import tbr
#from apps import bos
#from apps import tor
#from apps import mins
#from apps import cle
#from apps import chw
#from apps import kcr
#from apps import det
#from apps import hou
#from apps import oak
#from apps import tex
#from apps import laa
#from apps import sea
#from apps import atl
#from apps import wsn
#from apps import phi
#from apps import nym
#from apps import mia
#from apps import stl
#from apps import mil
#from apps import chc
#from apps import cin
#from apps import pit
#from apps import lad
#from apps import sdp
#from apps import sfg
#from apps import ari
#from apps import col

app.layout = html.Div([
    dcc.Location(id='url', refresh=False),

@app.callback(Output('page-content', 'children'),
              [Input('url', 'pathname')])
def display_page(pathname):
    if pathname == '/first':
        return first.layout
    elif pathname == '/pitch':
        return pitch.layout
    elif pathname == '/bal':
        return bal()
    elif pathname == '/nyy':
        from apps import nyy
        return nyy()
    elif pathname == '/tbr':
        from apps import tbr
        return tbr.layout
    elif pathname == '/bos':
        from apps import bos
        return bos.layout
    elif pathname == '/tor':
        from apps import tor
        return tor.layout
    elif pathname == '/mins':
        from apps import mins
        return mins.layout
    elif pathname == '/cle':
        from apps import cle
        return cle.layout
    elif pathname == '/chw':
        from apps import chw
        return chw.layout
    elif pathname == '/kcr':
        from apps import kcr
        return kcr.layout
    elif pathname == '/det':
        return det.layout
    elif pathname == '/hou':
        return hou.layout
    elif pathname == '/oak':
        return oak.layout
    elif pathname == '/tex':
        return tex.layout
    elif pathname == '/laa':
        return laa.layout
    elif pathname == '/sea':
        return sea.layout
    elif pathname == '/atl':
        return atl.layout
    elif pathname == '/wsn':
        return wsn.layout
    elif pathname == '/phi':
        return phi.layout
    elif pathname == '/nym':
        return nym.layout
    elif pathname == '/mia':
        return mia.layout
    elif pathname == '/stl':
        return stl.layout
    elif pathname == '/mil':
        return mil.layout
    elif pathname == '/chc':
        return chc.layout
    elif pathname == '/cin':
        return cin.layout
    elif pathname == '/pit':
        return pit.layout
    elif pathname == '/lad':
        return lad.layout
    elif pathname == '/sdp':
        return sdp.layout
    elif pathname == '/sfg':
        return sfg.layout
    elif pathname == '/ari':
        return ari.layout
    elif pathname == '/col':
        return col.layout
        return first.layout

if __name__ == '__main__':

My github is here and my website is here. Notice Baltimore Orioles (bal) in AL East works like I want it to, New York Yankees (nyy) does not. I’m using the import on start up with Baltimore and import on link click with New York.

This app runs locally but takes awhile to start up.

Any help or tips would be greatly appreciated!