i had used an sample web form "index.html"(it is in templates folder) in which it contains a text box to enter email .then the data should be posted to sample.py and it should be printed.but it is not happening,it simply showing 404 not found after clicking signup in web form.here is my code,please correct me if i am wrong ,and also please tell me how to run this in pycharm 4.5.i am a beginner. please help me.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<form action="/signup" method="post">
<input type="text" name="email">
<input type="submit" value="Signup">
</form>
</body>
</html>
my python code
from flask import Flask,request,redirect
app = Flask(__name__)
@app.route('/signup', methods = ['POST'])
def signup():
email = request.form['email']
print("The email address is '" + email + "'")
return redirect('/')