툴랩
close
프로필 배경
프로필 로고

툴랩

  • 분류 전체보기 (34)
    • DevLog (1)
    • Programming (18)
      • HTML (1)
      • Golang (1)
      • PHP (1)
      • Laravel (4)
      • Python (5)
      • Delphi (2)
      • Flutter (2)
      • Next.js (0)
      • Node.js (0)
      • Ruby (2)
    • Nothing (0)
    • Arduino (3)
    • Server (12)
      • RockyLinux (11)
      • CentOS (1)
  • Home
  • Tags
  • Guest
  • NaverBlog
  • YouTube

Flask, MySQL 세션를 이용한 로그인/로그아웃 예제

Flask 를 이용하여 MySQL 데이터베이스에 로그인하고 로그아웃하는 기본적인 Flask 예제입니다. 이 예제는 매우 단순한 형태이므로 실제 웹 애플리케이션에서는 보안, 에러 처리 등을 고려해야 합니다. Flask 와 MySQL 로그인/로그아웃 예제 라이브러리 설치 $ pip install flask flask-mysqldb 디렉토리 구조 /flaskapp /templates home.html login.html app.py app.py from flask import Flask, render_template, request, redirect, url_for, session from flask_mysqldb import MySQL import MySQLdb.cursors import re app = F..

  • format_list_bulleted Programming/Python
  • · 2023. 6. 28.
  • textsms
Python, Flask, ChatGPT API (OpenAI) 사용 예제

Python, Flask, ChatGPT API (OpenAI) 사용 예제

Python, Flask 를 이용해서 ChatGPT API 를 사용하는 간단한 예제입니다. 아래 OpenAI 사이트에서 API를 신청한 후 사용 가능합니다. app.py 에서 "your-openai-api-key"를 OpenAI 에서 발급받은 API 로 변경하시면 됩니다. https://platform.openai.com/overview OpenAI Platform Explore developer resources, tutorials, API docs, and dynamic examples to get the most out of OpenAI's platform. platform.openai.com 라이브러리 설치 $ pip install flask openai 디렉토리구조 project/ ├─ app...

  • format_list_bulleted Programming/Python
  • · 2023. 6. 22.
  • textsms
Python, Docker, Compose, Nginx, Flask, Gunicorn 연동하기

Python, Docker, Compose, Nginx, Flask, Gunicorn 연동하기

Docker 와 Python, Flask 연동 자료가 많이 있기는 하지만 안되는 자료가 많아 최소한으로 작동이 되는 예제를 만들었습니다. 디렉토리 구조 project/ │ ├─ app/ │ ├─ __init__.py │ ├─ main.py │ ├─ Dockerfile │ └─ requirements.txt │ ├─ nginx/ │ ├─ Dockerfile │ ├─ default.conf │ └─ nginx.conf │ └─ docker-compose.yml app/main.py from flask import Flask app = Flask(__name__) @app.route('/') def hello(): return "Hello World!" if __name__ == '__main__': app...

  • format_list_bulleted Programming/Python
  • · 2023. 6. 15.
  • textsms
  • navigate_before
  • 1
  • navigate_next
공지사항
전체 카테고리
  • 분류 전체보기 (34)
    • DevLog (1)
    • Programming (18)
      • HTML (1)
      • Golang (1)
      • PHP (1)
      • Laravel (4)
      • Python (5)
      • Delphi (2)
      • Flutter (2)
      • Next.js (0)
      • Node.js (0)
      • Ruby (2)
    • Nothing (0)
    • Arduino (3)
    • Server (12)
      • RockyLinux (11)
      • CentOS (1)
최근 글
인기 글
최근 댓글
태그
  • #laravel
  • #ChatGPT
  • #flask
  • #라라벨
  • #golang
  • #Flutter
  • #PHP
  • #rockylinux
  • #Laravel10
  • #Python
전체 방문자
오늘
어제
전체
Copyright © 쭈미로운 생활 All rights reserved.
Designed by JJuum

티스토리툴바