HTML form on Databricks notebook with login and ability to save files on ADLS gen2

Viewed 17

I want to make some kind of form for login. That requires to pass parameters from HTML form to Python. The idea is:

  1. Databricks locked Notebook with interface where user can login
  2. I have to pass params from HTML form to python (what would be the best way to do it?)
  3. After authentication, I want to save files on ADLS so: 3a. If I could get params from HTML form to python, that is no problem. 3b. but if I can not, maybe I can use javascript within HTML form to connect with ADLS, authenticate and save file.

Is there a simple way to pass parameters from HTML form back to python? Something like this:

from IPython.display import HTML

<script>
function myFunction() {
    document.getElementById("login").innerHTML;
}
</script>

h = '''
<form action="action_page.php" method="post">

  <div class="container">
    <label for="uname" id="login"><b>Username</b></label>
    <input type="text" placeholder="Enter Username" name="uname" required>

    <label for="psw"><b>Password</b></label>
    <input type="password" placeholder="Enter Password" name="psw" required>

    <button type="submit" onclick="myFunction()">Login</button>
    <label>
      <input type="checkbox" checked="checked" name="remember"> Remember me
    </label>
  </div>
</form>
'''
login = HTML(h)

Or are there only django/flask possibilities? :( If so, how can I connect straight to the ADLS from JS tags?

0 Answers
Related