파이썬 플라스크로 카카오맵 사용시

지도/로컬 API에 대한 문의게시판입니다.from flask import Flask, request, render_template
파이썬 플라스크 사용해서 map Api 사용한 HTML을 불렀을때

from flask import Flask, request, render_template

app = Flask(name)

@app.route(’/’)
def home():
return render_template(‘test.html’)

@app.route(’/result’,methods=[‘POST’, ‘GET’])
def result():
if request.method == ‘POST’:
result = request.form
return render_template(“test.html”,prediction = result)

if name == “main”:
app.run()

Document main
<body>
    <form action="/result" method="POST">
        <input type="text" id="inputValue" name="data1" /><input type="submit" value="검색" id="searchBtn" />
    </form>
    <input type="button" value="현위치로 검색" id="nowBtn" />

    <div id="map" style="width:800px; height:700px; text-align:center;"></div>
    <p  id="prediction">{{ prediction }}</p>
    <p id="test" style="display: none;">test</p>
    <!-- " -->
    <!-- script -->
    <script>
        let lat = 35.15360080380171;
        let lng = 126.80878276380653;
        var mapContainer = document.getElementById("map"), // 지도를 표시할 div
            mapOption = {
                center: new kakao.maps.LatLng(lat, lng), // 지도의 중심좌표
                level: 3 // 지도의 확대 레벨
            };

        // 지도를 생성합니다
        var map = new kakao.maps.Map(mapContainer, mapOption);
    </script>
</body>



<script>
// console.log("r");
// let r = $()
// console.log(r);
</script>

test.html을 불렀을 때 API가 적용되지 않아요 . 해결방법이 있을까요

http://apis.map.kakao.com/web/guide/ 가이드 따라
키 발급과 도메인 등록이 되어 있는지 확인 부탁드립니다.

또 에러 로그가 있다면 에러 로그도 함께 첨부해주세요.

1개의 좋아요