I am making a project using Flask. I am getting an error while running the app. Here is my code for python.
from flask import Flask,render_template
app = Flask(__name__)
app.route('/login')
app.route('/')
def login():
return render_template('login.html')
if __name__ == '__main__':
app.run(debug=True)
Here is the HTML page that I want to render.
{% extends 'base.html' %}
{% block title %}
Login | Websitename
{% endblock %}
{% block custom_styles %}
<style>
div.card, .login{
justify-content: center;
}
</style>
{% endblock %}
{% block main_content %}
<div class="d-flex login">
<div class="card d-flex">
<div class="card-body">
<h3 class="card-header">Login</h3>
<input type="text" name="email" placeholder="Email or Username">
<input type="password" name="password" placeholder="Password">
<button type="submit" name="button" class="btn btn-block btn-primary">LOGIN</button>
</div>
</div>
</div>
{% endblock %}
Here is the base.html code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="stylesheet" href="{{ url_for('static',filename='bootstrap.min.css') }}">
<title>{% block title %}{% endblock %}
</title>
{% block custom_styles %}{% endblock %}
</head>
<body>
{% block main_content %}{% endblock %}
<script src="{{ url_for('static',filename='bootstrap.min.js') }}" charset="utf-8"></script>
<script src="{{ url_for('static',filename='jquery.min.js') }}" charset="utf-8">
</script>
<script src="{{ url_for('static',filename='popper.min.js') }}" charset="utf-8">
</script></body></html>
I am using the PyCharm IDE. I copied the venv folder (only flask and other library files) from another flask project which is also using libraries used by this project. So is this ok to copy the venv folder's library files or I have to install all the libraries again for this project or other error in the code.
Thanks in advance...:)This is the error i am getting.
@over app