
from flask import Flask
app = Flask(__name__)
@app.route('/')
def home():
return 'This is Home!'
@app.route('/mypage')
def home():
return 'This is Mypage!!!'
if __name__ == '__main__':
app.run('0.0.0.0',port=5000,debug=True)
작성한 코드 및 에러 메세지
/Users/ihangyeol/Desktop/sparta/projects/prac/venv/bin/python /Users/ihangyeol/Desktop/sparta/projects/prac/app.py
Traceback (most recent call last):
File "/Users/ihangyeol/Desktop/sparta/projects/prac/app.py", line 9, in <module>
def home():
File "/Users/ihangyeol/Desktop/sparta/projects/prac/venv/lib/python3.10/site-packages/flask/scaffold.py", line 449, in decorator
self.add_url_rule(rule, endpoint, f, **options)
File "/Users/ihangyeol/Desktop/sparta/projects/prac/venv/lib/python3.10/site-packages/flask/scaffold.py", line 50, in wrapper_func
return f(self, *args, **kwargs)
File "/Users/ihangyeol/Desktop/sparta/projects/prac/venv/lib/python3.10/site-packages/flask/app.py", line 1358, in add_url_rule
raise AssertionError(
AssertionError: View function mapping is overwriting an existing endpoint function: home
종료 코드 1(으)로 완료된 프로세스
