- 아틀라스 연동 

 

copy

 

- 파이참에서 

파일 만들었음 

 

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 %}

 

 

+ Recent posts