main.py 505 B

12345678910111213141516171819202122
  1. #!/usr/bin/env python3
  2. import c
  3. import example_pages
  4. import home_page
  5. import theme
  6. from nicegui import app, ui
  7. # here we use our custom page decorator directly and just put the content creation into a separate function
  8. @ui.page('/')
  9. def index_page() -> None:
  10. with theme.frame('Homepage'):
  11. home_page.content()
  12. # this call shows that you can also move the whole page creation into a separate file
  13. example_pages.create()
  14. app.include_router(c.router)
  15. ui.run(title='Modularization Example')