Programing/Django

Integrate with MySQL

mjune.kim 2020. 3. 28. 11:50

1. 왜 MySQL 인가?

현업때 사용하던 sqlite3도 있지만 웹 어플리케이션 기획단계에서 가능하다면 많이 사용되고 있는 데이터베이스를 사용해 보고 싶었다. 

2. 설치하기

아래 링크를 따라하면 간단하게 설치가 가능하다.

https://django-mysql.readthedocs.io/en/latest/installation.html

 

Requirements and Installation — Django-MySQL 3.3.0 documentation

Extending your QuerySets Half the fun features are extensions to QuerySet. You can add these to your project in a number of ways, depending on what is easiest for your code - all imported from django_mysql.models. class Model The simplest way to add the Qu

django-mysql.readthedocs.io

3. Django app 에 django_mysql 추가하기

4. Django app 에서 확인하기

$> ./manage.py check

System check identified no issues (0 silenced).

[Error]

https://mjune.tistory.com/291

 

[Error] Failed building wheel for mysqlclient

Try to install these packets 1. build-essential $> sudo apt install build-essential 2. wheel $> pip install wheel

mjune.tistory.com