1.로그인
2.회원 가입
3.게시판
4.파일 업로드, 다운로드
5.마이 페이지
6.프로필 수정
7.데이터 또는 게시판 Pagination
HTML, JS, CSS, Bootstrap로 디자인
Python(Flask), JS, DBeaver, Jquery, Ajax, MySQL를 이용해서 서버에서 데이터를 처리
GIT, Sourcetree 이용해서 협업
천준기 : 메인페이지, 게시판별 페이지 + 페이지네이션(무한 스크롤)
정지우 : 로그인/회원가입페이지, 글 작성 페이지
(로그인, 회원가입 예외처리-중복체크/유효성검사 + 아이디 저장 + 아이디 찾기 + 회원탈퇴 + Tiny Editor 이용 +글 작성시 이미지 저장경로)
장빈 : 마이페이지, 프로필 수정 페이지
변준혁 : 글 상세 페이지
가장 마지막에 작성한 코드인데, 지금까지 작성해온 코드(암호화/sql문)를 바탕으로 혼자서 작성해낸 코드라서 가장 마음에 듭니다!
# 회원탈퇴-----------------------------------------------------
@app.route('/delete/user', methods=['POST'])
def deleteUser():
db = pymysql.connect(
user='',
password='',
host='',
port=3306,
database='',
charset='utf8'
)
curs = db.cursor()
idf = request.form['idf']
pwf = request.form['pwf']
byte_input = pwf.encode('UTF-8')
# print(idf, pwf, 2)
sql_check = f'select password from `user` where id = "{idf}" '
curs.execute(sql_check)
print(sql_check)
result = curs.fetchone()
print(result)
if result is None:
return jsonify({'msg': '회원이 아닙니다.'})
origin_pw = bytes.fromhex(result[0])
pw_check = bcrypt.checkpw(byte_input, origin_pw)
db.commit()
db.close()
if pw_check is None:
return jsonify({'msg': '회원이 아닙니다.'})
db = pymysql.connect(
user='',
password='',
host='',
port=3306,
database='',
charset='utf8'
)
curs = db.cursor()
idf = request.form['idf']
pwf = request.form['pwf']
sql_check = f'delete from `user` where id = "{idf}" '
curs.execute(sql_check)
db.commit()
db.close()
return jsonify({'msg': '회원탈퇴가 되었습니다.'})
일단 sql강의 복습도 필요하고, 준기님이 사용하신 flask를 이용해 html문서를 html문서안에 넣는 방법에 대해서 공부가 필요하다!
<body>
{% include "components/header.html" %}
<div class="container-fluid">
<div class="row">
<div class="col-2"> <!-- [뉴스피드 분류], [나의 프로필] -->
{% include "components/category_list.html" %}
{% if session['id'] and component_name != 'mypage' and component_name != 'useredit' %}
{% include "components/my_profile.html" %}
{% endif %}
</div>
<div class="col-10"> <!-- [랜덤 프로필 & 뉴스피드], [마이 페이지], [프로필 수정 페이지] -->
{% include "components/random_profile.html" %}
{% if component_name == 'category' %}
{% include "components/main_category.html" %}
{% else %}
{% include "components/main.html" %}
{% endif %}
<div class="d-flex justify-content-center" style="height: 32px; margin: 50px 0;"> <!-- 로딩 효과용 box -->
<div class="spinner-border" id="loading-icon" role="status"></div>
<div id="loading-message" style="display: none;">게시글이 없습니다. 새 게시글을 작성해주세요!</div>
</div>
</div>
</div>
</div>
</body>