- 아틀라스 연동
- 파이참에서
mongodb+srv://jinhae:qscft7259*@jinhae-cluster.lsfcp.mongodb.net/jinhae-db?retryWrites=true&w=majority
-터미널에서 설치
pip install dnspython
-app.py 에 추가
@app.route('/atlas_connect_info')
def atlas_connect_info():
filename = 'atlas_connect_info.txt'
with open(filename, encoding='utf-8') as f:
atlas_connection_info = f.read()
return render_template('atlas_connect_info.html',
atlas_connection_info=atlas_connection_info)
-layout.html
수정
<a class="dropdown-item" href="/atlas_connect_info">atlas 접속 정보</a>
- atlas_connect_info.html
{% extends "layout.html" %}
{% block content %}
<form action="/atlas_connect_info_update" method="post">
<div class="mb-3">
<label for="atlas_connect_info" class="form-label">atlas 접속 정보:</label>
<input type="text" value="{{ atlas_connection_info }}" class="form-control" id="atlas_connect_info" name="atlas_connect_info" aria-describedby="emailHelp">
<div id="atlas_connect_info_Help" class="form-text">atlas 원격 접속 정보입니다.</div>
</div>
<button type="submit" class="btn btn-outline-secondary">저 장</button>
</form>
{% endblock content %}
- atlas_connect_info_update_result.html
{% extends "layout.html" %}
{% block content %}
결과
{% endblock content %}
'mongodb' 카테고리의 다른 글
몽고디비 - 날씨, 온도표시 (0) | 2021.01.22 |
---|---|
몽고디비 7일차 - book_store 시간, 검색기능 추가 (0) | 2021.01.22 |
몽고디비- 홈페이지 ip:포트번호 로 접속하기 (0) | 2021.01.21 |
몽고디비- 6일차/ bootstrap 활용해서 bookstore 업데이트 (0) | 2021.01.21 |
몽고디비 5일차- book list (0) | 2021.01.20 |