사전캠프 없이 프로그램에 바로 참여했기 때문에 어제와 오늘은 강의 듣기로 바쁘다.
folder 생성 => app.py file 만들기 => git bash terminal에서 'python -m venv venv'를 입력하여 라이브러리들을 넣을 venv(가상환경)라는 folder를 생성 => Python 3.10.4('venv':venv)로 잡아주기 => 'pip install flask' =>
flask 시작 코드
from flask import Flask
app = Flask(__name__)
@app.route('/')
def home():
return 'This is Home!'
if __name__ == '__main__':
app.run('0.0.0.0',port=5000,debug=True)
=> Run Python file in Terminal => 브라우저에서 'localhost:5000'
*mongoDB를 사용하고 싶다면,
pip install pymongo
pip install dnspython
index.html 뼈대 코드
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<title>Document</title>
<script>
function hey(){
alert('안녕!')
}
</script>
</head>
<body>
<button onclick="hey()">나는 버튼!</button>
</body>
</html>
LIST
'Computer Programming > AI' 카테고리의 다른 글
TIL_sql 정리(+첫 번째 team project presentation and feedback) (0) | 2023.08.11 |
---|---|
TIL_github에 있는 폴더 git 명령어로 삭제 방법 (0) | 2023.08.10 |
TIL_Github에 code upload (0) | 2023.08.09 |
TIL_Git과 Github (0) | 2023.08.07 |
내 컴퓨터와 github 연동하기(ssh 설정) (0) | 2023.08.07 |