Django의 버그 처리

1194 단어 테크니컬
Django의 버그 처리
BUG
When I run this shell code, it will showed this error tips:
mysqlclient 1.3.13 or newer is required; you have 0.9.3.
solve
  • http://www.bubuko.com/infodetail-3040101.html
  • Django 2.2 -> Django 2.1.4
  • find base.py and comment this code in 35 line.
  • 
        if version < (1, 3, 3):
            raise ImproperlyConfigured("mysqlclient 1.3.3 or newer is required; you have %s" % Database.__version__)
    
    
  • Find operations.py and changed “decode” to “encode” in 146 line.
  • 
        # query = query.decode(errors='replace')
        query = query.decode(errors='replace')
    
    


    Coding
    Create django models
  • Create models.py in projects.
  • Setting models in settings.py
    
        INSTALLED_APPS = [
            'polls.apps.PollsConfig',
        ]
    
    
  • Run code in main file
    
        > python manage.py makemigrations polls
    
    
  • Run code in main file, create tables in the mysql.
    
        > python manage.py migrate
    
    
  • 좋은 웹페이지 즐겨찾기