구글코랩) 심플 웹서버 소스를 공유합니다. (Google Colaboratory, Flask, JINJA2, MySQL, NGROK)

 

...(중략)

app = Flask(__name__)
run_with_ngrok(app)

@app.route('/')
def index():
  return render_template('index.html')

@app.route('/list')
def list():
  keyword = request.args.get('keyword', default = 'coronafact', type = str)
  limit = request.args.get('limit', default = '10', type = str)
    
  conn = db_access()
    
  data = exec_list(conn,keyword,limit)

  session = {}

  session['keyword'] = str(keyword)
  session['limit'] = str(limit)
  
  return render_template('/coronafact.html',data=data,session=session)


app.run()

자세한 소스는 아래의 사이트를 참고하세요

댓글

이 블로그의 인기 게시물

[OS] 리눅스 한글설정관련 스크랩

[JAVA] 자바 정규식사용