Need help to ensure password complexity is enforced
current code
app.py from datetime import date from flask import Flask, render_template app = Flask(__name__) @app.route('/') @app.route('/index.html') def home(): return render_template('index.html', date = date.today() ) @app.route('/page2.html') def page2(): return render_template('page2.html', date = date.today() ) @app.route('/page3.html') def page3(): return render_template('page3.html', date = date.today() ) if __name__ == '__main__': app.run(debug = True) index.html <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Index Page</title> <link rel= "stylesheet" type= "text/css" href= "{{ url_for('static',filename='styles/style.css') }}"> </head> <style> img{ height:500px; width:1500px; } table,td{ border: 1px solid black; } form{ display:flex; flex-direction:column; } button{ width:200px; } .login-form{ width:300px; } input{ margin:5px; padding:10px; } </style> <script> function isStrongPwd(password){ var regExp = /(?=.*\d)(?=.*[a-z])(?=.*[!@#$%&*()]).{12,}/; var validPassword = regExp.test(password) return validPassword; } </script> <body> <h1>Page 1</h1> <h2>Heading 2</h2> <h3>Heading 3</h3> <div class="separate"> <ol> <li>One</li> <li>Two</li> </ol> </div> <div class="separate"> <ul> <li>One</li> <li>Two</li> </ul> </div> <h1>Images section</h1> <div> <img src="im1.jpg" alt ="image1"> <img src="im2.jpg" alt ="image2"> <img src="im3.jpg" alt = "image3"> <img src="im4.jpg" alt ="image4"> </div> <h1>Table section</h1> <div> <table> <tr> <td>row1column1</td> <td>row1column2</td> <td>row1column3</td> </tr> <tr> <td>row2column1</td> <td>row2column2</td> <td>row2column3</td> </tr> <tr> <td>row3column1</td> <td>row3column2</td> <td>row3column3</td> </tr> <tr> <td>row4column1</td> <td>row4column2</td> <td>row4column3</td> </tr> </table> </div> <h1>User Registration form</h1> <div> <form> <h3>Register</h3> <p>Please fill in this form to create an account.</p> <div> <label for="email"><b>Email</b></label> <input type="text" placeholder="Enter Email" name="email" id="email" required> </div> <div> <label for="psw"><b>Password</b></label> <input type="password" placeholder="Enter Password" name="psw" id="psw" required> </div> <div> <label for="psw-repeat"><b>Repeat Password</b></label> <input type="password" placeholder="Repeat Password" name="psw-repeat" id="psw-repeat" required> </div> <button type="submit" class="registerbtn">Register</button> </form> </div> <h1>Login form</h1> <form class="login-form"> <input type="text" placeholder="Username"> <input type="password" placeholder="Password"> <input type ="button" value="Login" onclick="isStrongPwd()"> </form> <!--Display the date passed from python--> <p>Today is {{date}}</p> <br> <a href="https://www.google.com">Visit Site1</a> <a href="https://www.google.com">Visit Site2</a> <a href="https://www.google.com">Visit Site3</a> <br> <a href="/page2.html">Page 2</a> <a href="/page3.html">Page 3</a> </body> </html> page2.html <html> <head> <title>Page 2</title> <link rel= "stylesheet" type= "text/css" href= "{{ url_for('static',filename='styles/style.css') }}"> </head> <body> <h1>Page 2</h1> <h2>Heading 2</h2> <h3>Heading 3</h3> <div class="separate"> <ol> <li>One</li> <li>Two</li> </ol> </div> <div class="separate"> <ul> <li>One</li> <li>Two</li> </ul> </div> <!--Display the date passed from python--> <p>Today is {{date}}</p> <br> <a href="https://www.google.com">Visit Site1</a> <a href="https://www.google.com">Visit Site2</a> <a href="https://www.google.com">Visit Site3</a> <br> <a href="/index.html">Home Page</a> <a href="/page3.html">Page 3</a> </body> </html> page3.html <html> <head> <title>Page 3</title> <link rel="stylesheet" type="text/css" href="{{ url_for('static',filename='styles/style.css') }}"> </head> <body> <h1>Page 3</h1> <h2>Heading 2</h2> <h3>Heading 3</h3> <div class="separate"> <ol> <li>One</li> <li>Two</li> </ol> </div> <div class="separate"> <ul> <li>One</li> <li>Two</li> </ul> </div> <!--Display the date passed from python--> <p>Today is {{date}}</p> <br> <a href="https://www.google.com">Visit Site1</a> <a href="https://www.google.com">Visit Site2</a> <a href="https://www.google.com">Visit Site3</a> <br> <a href="/index.html">Home Page</a> <a href="/page2.html">Page 3</a> </body> </html> <head> <title>Page 3</title> <link rel=stylesheet type=text/css href={{ url_for(static,filename style.css .separate{ margin-top: 10px; }