Minimal Application
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'
Running flask application?
$ export FLASK_APP=hello.py
$ flask run
DEBUG=TRUE so that you dont need to start the server over and over when there is a change
$ export FLASK_DEBUG=1
$ flask run
or add this
if __name__ == '__main__':
app.run(host='127.0.0.1',port=4455,debug=True) // Changed port number (Not needed)
Output:
kill -9 `lsof -i:5000 -t`
How to add Login Page?
- Create Python class
- Add {{form.username(class="form-control form-control-lg")}}
- Add methods=['GET', 'POST'] in register route
- Adding Flash message
This Repository is developed and maintained by
Rohit Singh