본문으로 바로가기

사회적 거리두는 블로그

현재위치 :: HOME BLOG CATEGORY SEARCH ARCHIVE TAGS MEDIA LOCATION GUESTBOOK

네비게이션

    관리자
    • 블로그 이미지
      JohnWick99

      프로그래밍, 꿀팁 정보를 알려드립니다.

      링크추가
    • 글쓰기
    • 환경설정
    • 로그인
    • 로그아웃

    파이썬 Flask HTTP Request 파라미터

    예제1 GET, POST 파라미터에 접근하는 방법에 대한 예제입니다. app.py from flask import Flask, request app = Flask(__name__) @app.route('/') def index(): return 'hello' @app.route('/getReq', methods=['GET']) def r(): return request.args.get('page') @app.route('/postReq', methods=['POST']) def pr(): if request.form.get('secret') == '0820': return 'today' else: return request.form.get('secret') if __name__ == '__main__':..

    Application/Flask 2020. 8. 20. 22:06

    파이썬 Flask 라우팅(route) 알아보기

    예제1 Method Filtering 에 대한 예제입니다. 요청을 허용하는 Method 를 지정할 수 있습니다. from flask import Flask, Response, make_response app = Flask(__name__) @app.route('/req', methods=['GET', 'POST']) def res(): print() return 'res' @app.route('/postReq', methods=['POST']) def pr(): print() return 'pr' @app.route('/') def index(): return 'hello' if __name__ == '__main__': app.run(debug=True) 127.0.0.1 - - [20/Aug/2020..

    Application/Flask 2020. 8. 20. 22:05

    파이썬 Flask 폼(Form) 전송

    폼 전송 Flask from flask import Flask, render_template, redirect, url_for, request app = Flask(__name__) @app.route('/') @app.route('/index') def index(): return render_template('index.html') @app.route('/form_send') def form_send(): return render_template('form_send.html') @app.route('/form_recv', methods=['POST']) def form_recv(): if request.method == 'POST': data = request.form else: data = {} r..

    Application/Flask 2020. 7. 29. 15:45

    파이썬 Flask render_template() 데이터 전달 / for 문 사용

    HTML 로 데이터 전달 Flask from flask import Flask, render_template, redirect, url_for app = Flask(__name__) @app.route('/') @app.route('/index') def index(): return render_template('index.html') @app.route('/review') def review(): return render_template('review.html') @app.route('/test') def test(): color = 'red' colors = ['red', 'green', 'blue'] blogger = {'name': 'jvvp', 'eloc': 'songpa'} return ren..

    Application/Flask 2020. 7. 29. 14:53

    파이썬 Flask 리다이렉트(Redirect)와 에러 페이지

    리다이렉트와 에러 Quickstart — Flask Documentation (1.1.x) For web applications it’s crucial to react to the data a client sends to the server. In Flask this information is provided by the global request object. If you have some experience with Python you might be wondering how that object can be global and how flask.palletsprojects.com 리다이렉트 또는 없는 페이지에 대한 에러 처리는 다음 문서에서 참고합니다. 지난 포스팅까지 두 개의 페이지를 만들었었는데..

    Application/Flask 2020. 7. 29. 13:17

    파이썬 Flask 반응형 템플릿 구해서 고치기 -2 : 리소스 경로잡기(Static Files)

    리소스 경로잡기 Static Files — Flask Documentation (1.1.x) Static Files The authentication views and templates work, but they look very plain right now. Some CSS can be added to add style to the HTML layout you constructed. The style won’t change, so it’s a static file rather than a template. Flask automatical flask.palletsprojects.com static 디렉터리안에 리소스를 넣으면 상대 경로(static == .)로 접근 가능하다는 내용입니다. 지난 포스팅에서..

    Application/Flask 2020. 7. 29. 12:02

    파이썬 Flask 반응형 템플릿 구해서 고치기 -1 : 무료 템플릿 다운로드

    반응형 웹 템플릿 구하기 다운로드시 다른 링크로 옮겨가긴하지만 템플릿, 디자인, 효과 등 보기좋게 되어 있습니다. 웹쟁이 | 무료 웹소스 제공 무료디자인소스, 무료PSD 다운, 무료템플릿, 반응형웹 제작, html5, 제이쿼리, 무료 스크립트, 그누보드CMS,워드프레스 www.webjangi.com 심플한 템플릿이 많습니다. TEMPLATED A collection of 867 Creative Commons-licensed CSS, HTML5 and Responsive site templates created by Cherry, Doni, AJ, and co. templated.co 비슷한 디자인이 많지만 분류를 잘해놓은 것 같습니다. HTML5 UP Responsive HTML5 and CSS3 sit..

    Application/Flask 2020. 7. 29. 11:21

    파이썬 Flask 템플릿(Templates) 사용하기 : 문서 읽어보기

    Templates — Flask Documentation (1.1.x) Templates You’ve written the authentication views for your application, but if you’re running the server and try to go to any of the URLs, you’ll see a TemplateNotFound error. That’s because the views are calling render_template(), but you haven’ flask.palletsprojects.com 문서 읽어보기 위 Flask Tutorial 코드에서 가져와 보았습니다. {% ~ %} 이런 부분들이 눈에 띄네요. if else elseif , 아마도..

    Application/Flask 2020. 7. 28. 18:25
    • 이전
    • 1
    • 2
    • 다음

    사이드바

    반응형

    CATEGORY

    • 분류 전체보기 (246)
      • Environment (3)
        • VSCode (1)
      • Linux(2020) (3)
      • API (14)
      • Crawling (11)
        • Basic (8)
        • Data (3)
      • Language (71)
        • Python (61)
        • Javascript (7)
        • Dart (3)
      • Application (35)
        • Flutter (11)
        • Flask (9)
        • PyQt5 (15)
      • AI (5)
        • ML (4)
      • IoT (24)
        • Raspberry Pi (24)
      • OpenCV (28)
      • Bot (8)
      • Errors (9)
      • Tools (3)
      • OS(~2018) (31)
        • Server (8)
        • Window (4)
        • Linux (16)
        • Tools (3)
    • 홈으로
    • 방명록
    • 로그인
    • 로그아웃
    • 맨위로
    SKIN BY COPYCATZ COPYRIGHT 사회적 거리두는 블로그, ALL RIGHT RESERVED.
    사회적 거리두는 블로그
    블로그 이미지 JohnWick99 님의 블로그
    MENU
      CATEGORY
      • 분류 전체보기 (246)
        • Environment (3)
          • VSCode (1)
        • Linux(2020) (3)
        • API (14)
        • Crawling (11)
          • Basic (8)
          • Data (3)
        • Language (71)
          • Python (61)
          • Javascript (7)
          • Dart (3)
        • Application (35)
          • Flutter (11)
          • Flask (9)
          • PyQt5 (15)
        • AI (5)
          • ML (4)
        • IoT (24)
          • Raspberry Pi (24)
        • OpenCV (28)
        • Bot (8)
        • Errors (9)
        • Tools (3)
        • OS(~2018) (31)
          • Server (8)
          • Window (4)
          • Linux (16)
          • Tools (3)
      VISITOR 오늘 / 전체
      • 글쓰기
      • 환경설정
      • 로그인
      • 로그아웃
      • 취소

      검색

      티스토리툴바