Open kcpevey opened 1 week ago
I have a more complicated example where the equivalent of:
if __name__ == "__main__":
app = pn.Column('stuff')
app.panel().servable()
does NOT work - i.e. it "deploys" but just shows a blank screen. I don't understand why there would be a difference though. At any rate, its safe to say that placing .servable
inside of __main__
produces mixed results. Its safer to stay away from __main__
.
Preliminary Checks
Summary
There are some usecases in Panel which don't directly support the
.servable()
approach to deploying.For those that DO support
.servable()
putting it in a python file protect by main works well:However, in the case of pipelines, direct usage of
.servable()
is not possible and the docs suggest usingpn.serve
. As far as I can tell, jhub-apps doesn't support this approach (or I couldn't sort out the syntax while testing). Instead, I needed to usepn.panel(pipeline).servable()
.HOWEVER, this could not be within the protected
main
. For example this works:But this doesn't work:
There are errors in the logs which may be relevant:
Steps to Resolve this Issue
Add some documentation to explain the recommended approach to deploying these kinds of Panel apps.