, поэтому у меня есть этот шаблон html, который я использую в качестве почтового шаблона для отправки своим пользователям для сброса их паролей. Я хочу использовать bootstrap 4 classes
в шаблоне, но он не работает. Как мне сделать эту работу? Я пробовал inline css
, и он отлично работает, но я хочу использовать bootstrap 4 css
. Любая помощь будет оценена.
HTML шаблон
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{title}}</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<link href="https://fonts.googleapis.com/css2?family=Poppins&family=Rubik:wght@300&display=swap" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="text-center">
<h2>Have you just requested for the password reset !</h2>
<a href="#" class="btn btn-outline-success">Reset Password</a>
</div>
</div>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" charset="utf-8"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.bundle.min.js" charset="utf-8"></script>
</body>
</html>
Flask Код
@app.route('/forget', methods=['GET', 'POST'])
def forget_password():
form = ForgetPassword()
if request.method == 'GET':
return render_template("forget.html", title="Forget Password", form=form)
email = request.form['email']
session['email'] = email
token = s.dumps(email, salt='reset-password')
msg = Message("Password Reset", sender="bookverm1999@gmail.com", recipients=[email])
link = url_for("reset_pass", token=token, _external=True)
msg.body = "Password Reset Link"
msg.html = render_template("mail.html", link=link, title="Password Reset")
mail.send(msg)
return render_template("sent.html", title="Email Sent")