티스토리 뷰

1. make a directory

2. python -m venv 만들디렉토리이름

3. PS C:\DEV\aProject\env\Scripts> & .\activate 

    source is a shell command designed for users running on Linux (or any Posix, but whatever, not Windows).

4. 가상환경으로 들어옴

    (languageDict) C:\python_work\venvproject\languageDict\Scripts>  

    (languageDict) C:\python_work\venvproject\languageDict\Scripts>pip install django

5. maria db install 

6. 시작>mariadb>mariadb_client 

show databases;

create database table;

use table;

7.  python 과 mariadb 연결하기 위한 드라이버 설치

   pip install libmysqlclient-dev

   or,    pip install mysqlclient

   or,    설치 실패시에 아래 경로에서 .whl 파일 다운로드 
   https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python
 

9. settings.py

DATABASES = {

'default': { #'ENGINE': 'django.db.backends.sqlite3',

              #'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),

'ENGINE': 'django.db.backends.mysql',

'NAME': 'db-name', #mysql

'USER': 'db-user-name', #root 'PASSWORD': 'db-password', #1234

'HOST': 'db-adress', #공백으로 냅두면 default localhost 'PORT': 'port-number' #공백으로 냅두면 default 3306 } }

 

9.

    python manage.py makemigrations

    python manage.py migrate

 

 

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/06   »
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
글 보관함