Error in multipage application with dynamic path variables

in multipage application when dynamic path variables are set and static html is set in Iframe I get loop error

when dynamic variable is set to path_template=“/report/<report_id>”
I get an error, and when a non-dynamic path is set, for example, such path_template=“/report” the error disappears, but I need to work according to the first principle

you can see the complete example with errors published in my github Github

Hello @Sohibjon,

In the template, do you allow for the report_id to be blank?

if report_id:
    layout = full layout
else:
    layout = layout without report_id
return layout

report_id is never empty, you can see my code posted in github

What error does it give?

I see that you are returning it directly to the page layout.

I am getting the following error

Hi @Sohibjon

Thanks for providing a minimal example in GitHub - it makes it much easier to help.

I think the problem is with the html file in the assets folder. I tried a different html file and it works fine.

Just for debugging, try changing the layout in the dashboard.py file to this:

def layout(project_name=None):    
    return html.Div([
        project_name,
        html.Iframe(
            src="https://www.ons.gov.uk/visualisations/dvc914/map/index.html",  
            style={"height": "1080px", "width": "100%"},
        )
    ])
1 Like

Yes, the problem is in the html file. I want to display an html file generated by pandas profiling. Could you help me how to do it right? Pandas Profiling

here is the minimal code how pandas profiling works

import numpy as np
import pandas as pd
from pandas_profiling import ProfileReport

df = pd.DataFrame(np.random.rand(100, 5), columns=["a", "b", "c", "d", "e"])
profile = ProfileReport(df, title="Pandas Profiling Report")
profile.to_file("your_report.html")

and this html needs to be displayed in layout