Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
Tags
- 한글 깨짐
- smarty
- 확장자
- 일괄변경
- TPL
- ubuntu
- 문자열자르기
- replace
- Python
- jQuery
- docker
- Eclipse
- JavaScript
- Selectbox
- install
- MySQL
- Oracle
- 천단위
- php
- centos
- yum
- i18n
- RabbitMQ
- 부모창
- mariadb
- SVN
- Postfix
- random
- TextBox
Archives
- Today
- Total
wilson's story
python ORM 생성 sqlacodegen 라이브러리 한글 깨짐 본문
반응형
python에서 orm으로 작업하기 위해서는 table을 Model로 만들어줘야한다
이걸 자동으로 해주는 라이브러리 sqlacodegen
https://github.com/agronholm/sqlacodegen
설치방법
pip install sqlacodegen
Mariadb 사용법
sqlacodegen "mysql+pymysql://user:password@host:port/dbname" > models.py
comment에서 한글이 깨질 경우
sqlacodegen "mysql+pymysql://user:password@host:port/dbname?charset=euckr" > models.py
# models.py 파일을 vscode로 열고 Encoding을 EUC-KR로 변경 하면 commnet의 한글이 안깨지고 잘 보임
# charset=euckr 해서 생성된 파일을 pycharm 에서 바로 열면 깨져 보인다, 그래서 vscode에서 열어서 하단의 파일 Encoding의 UTF-8을 EUC-KR로 변경하면 한글이 잘 보인다
반응형