Multi page layout, where to do startup processing?

It’s likely being executed twice because you have debug=True set for run_server discussed earlier here:

  1. Code in if __name__ == '__main__' runs twice?
  2. Why global code runs twice

So set debug=False to speed it up. As for where to put the slow parts of your code that is up to you!

1 Like