from flask import Flask
from flask import url_for,render_template,request
app = Flask(__name__)
@app.route("/hello/", methods=['POST','GET'])
def profile(username=None):
error = None
if request.method == 'POST':
username = request.form['username']
email = request.form['email']
if not username and not email:
return add_profile(request.form)
else:
error='Invalid username or email'
if __name__=="__main__":#
app.run(debug=True)
Flask 책에서 본 코드입니다.
거의 초반 부분인데요 실행해서 /profile/로 넘어가면
Not Found
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
라는 에러가 뜹니다.
사실 저 코드를 잘 이해하지 못해서 에러를 해결하지도 못하고 꼼짝 못하고 있습니다.
저 코드가 뭐하는 코드이며 어떻게 동작되는지 설명해 주실 수 있으신 마음씨 좋은 개발자분 정보좀 부탁 드립니다.