Season 1 아카이브/프로그래밍
                
              MariaDB 장고 프레임워크 연동
                문장전달자
                 2016. 3. 19. 18:03
              
              
                    
        728x90
    
    
  1. 커넥터 설치
mysql-python 은 파이썬 3.5 를 지원하지 않는다.
아래와 같이 3.5를 지원하는 커넥터를 설치한다.
sudo apt-get install libmysqlclient-dev 
pip install mysqlclient
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  | raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named 'MySQLdb' (envalpha)root@localhost:~# conda install mysql-python Fetching package metadata: .... Solving package specifications: .. Error: Unsatisfiable package specifications. Generating hint: [      COMPLETE      ]|##############################################################| 100% Hint: the following packages conflict with each other:   - mysql-python   - python 3.5* Use 'conda info mysql-python' etc. to see the dependencies for each package. (envalpha)root@localhost:~# sudo apt-get install libmysqlclient-dev (envalpha)root@localhost:~# pip install mysqlclient  | cs | 
2. settings.py 파일 수정
1 2 3 4 5 6 7 8 9 10 11  | DATABASES = {     'default': {         'ENGINE': 'django.db.backends.mysql',         'NAME': 'databasename',         'USER': 'root',         'PASSWORD': 'rootpassword',         'HOST': '127.0.0.1',         'PORT': '3306',     }          }  | cs | 
3. migration 실시
1 2  | python manage.py makemigrations blog python manage.py migrate  | cs | 
4. 관리자 게정 생성
1  | python manage.py createsuperuser  | cs | 
728x90