Can I delete a page programmatically? #1692
-
QuestionHi All, I wanted to know if we can delete the page routes that we create using the For ex: I was testing some menu buttons and so I did a simple page function like this: @ui.page('/{icon}')
def icon_page(icon):
ui.label(f'This page is for {icon}')This is just for me to test out if the button clicks were working and the pages were opening etc, because I was trying to insert my buttons in middle of a long code. Now that is done, is there a way to delete the pages? I mean even if I remove the functions, the pages are already created and I can manually type in the URL and still access them. I guess one way is to restart the app. But is there a way to programmatically delete the pages from python? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
We use something like this app.routes[:] = [routes for routes in app.routes if routes.path != '/home']Which will remove the |
Beta Was this translation helpful? Give feedback.
We use something like this
Which will remove the
/homepage from FastAPI.