Closed go-kool closed 1 year ago
So app_root
is something that is meant to be used when serving D-Tale up within jupyerhub. There is a server proxy that opens up all flask routes using a different URL path.
I can try seeing if I can make use of Flask's url_prefix
parameter, but honestly your best bet is to do something like using different ports (i think you just need to open both ports in your docker configuration):
import dtale
import pandas as pd
d = dtale.show(pd.DataFrame([1,2,3,4,5]),host='localhost', port="40000")
d._main_url
d1 = dtale.show(pd.DataFrame([1,2,3,4,5]),host='localhost', port="40001")
d1._main_url
Or you can apply names to your data:
import dtale
import pandas as pd
d = dtale.show(pd.DataFrame([1,2,3,4,5]),host='localhost', name="satya")
d._main_url # http://localhost:40000/dtale/main/satya
d1 = dtale.show(pd.DataFrame([1,2,3,4,5]),host='localhost', name="test", ignore_duplicate=True)
d1._main_url # http://localhost:40000/dtale/main/test
Thanks for the suggestion @aschonfeld its really helpfull, I tried giving names to data and its working good. But i getting some Bad request errors in my jupyter notebook continuously, however I am able to access the Dtale with the urls below. http://localhost:40000/dtale/main/satya http://localhost:40000/dtale/main/test
Is there any way we can do this without errors ?
Are you hitting the D-Tale URLs from https? I've never seen that error and the only thing I can find about it is when someone tries to hit a flask endpoint from https that is only setup for http: https://stackoverflow.com/questions/58902838/python-flask-error-code-400-message-bad-request-version
@aschonfeld I getting the error as soon as I run the second cell attached in the above screenshot. I am accessing it on http.
So I was able to run your code in a jupyter notebook with no issue. Is your notebook running under HTTPS?
@aschonfeld Yes, Its running inside Kubenertes clusters and exposed using ingress on Https
ok then thats the problem. Do you have to use HTTPS?
@aschonfeld Yes, We need to run our service on https only
So what I plan on doing is exposing the ability to specify an ssl_context
when starting up the flask process invoked by dtale.show
. This way you can call something like dtale.show(..., ssl_context="adhoc")
and it should allow you to use HTTPS.
I'll keep you posted about when this change gets released
@go-kool @nandinibalusu978 just released v3.6.0 to pypi (should be on conda-forge soon) with this fix included.
Also, if you haven't already, please put your ⭐ on the repo when you get a sec. Thanks! 🙏
Hi Team,
We have a requirement to run the multiple Dtale serives in one docker container. So we are planning to run each dtale service with a unique app-root and port. Below is my code looks like.
import dtale import pandas as pd d = dtale.show(pd.DataFrame([1,2,3,4,5]),host='localhost',app_root="/satya",port="40000") d._main_url
d1 = dtale.show(pd.DataFrame([1,2,3,4,5]),host='localhost',app_root="/test",port="40001") d1._main_url
Below is the error we are getting when accessing the dtale url.
we are not sure if this is an issue or not. Please suggest us if we need to make any changes.