I am trying to create a Python / flask webapp which takes a query equal to a dropbox directory, then opens windows explorer to that location. It works on a local machine but I need it to work on my Heroku server.
I have tried using %HOMEPATH% / "Dropbox Directory"
which works when I copy and paste into the directory.
@app.route("/", methods=["GET","POST"])
def redirect_URL():
url = request.args.get('url')
HP = str(Path.home())
path = Path(HP + url)
string = r'explorer "{}"'.format(path)
print(string)
subprocess.Popen(string)
return "success"
When something like domain.com/?url="dropbox directory"
the app should open windows explorer to that location.
The above code runs fine on the local system. But Path.home returns the app folder