Forums

head first project

I've followed the instructions in Head First Python and deploy this code

from flask import Flask, render_template, request from vsearch import search4letters

app = Flask(name)

@app.route('/search4', methods=['POST']) def do_search() -> 'html': phrase = request.form['phrase'] letters = request.form['letters'] title = 'Here are your results:' results = str(search4letters(phrase, letters)) return render_template('results.html', the_title=title, the_phrase=phrase, the_letters=letters, the_results=results,)

@app.route('/') @app.route('/entry') def entry_page() -> 'html': return render_template('entry.html', the_title='Welcome to search4letters on the web!') if name == 'main': app.run(debug=True)

and I always get just a web-page Hello from Flask.After this i check my source and it`s change to this

A very simple Flask Hello World app for you to get started with...

from flask import Flask

app = Flask(name)

@app.route('/') def hello_world(): return 'Hello from Flask!'

When you create a Flask web app, it overwrites the flask_app.py file in the directory that you specified and it warns you that that is what will happen.