Configuring Django in local dev environment to work with imported MySQL database -


i use sqlite project requires me use data server instead of trying convert data sqlite mysql, imported data local mysql database. trying figure out how configure django project work imported database. right models.py file empty.

so have 3 questions:

  1. is settings.py (below) set correctly?

  2. do need set models match schema in imported database?

  3. do need else?

this i'm working with:

  • django 1.8.4
  • python 2.7
  • mysql 5.7.14
  • osx 10.11

settings.py

import os  base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))  """..."""  databases = {     'default': {         'engine': 'django.db.backends.mysql',         'name': 'extract',         'user': 'root',         'password': 'xxxxxxxxxx',         'host': 'localhost',         'port': '22',     } } """ ... """ 

you can try ./manage.py inspectdb after mentioning mysql database in settings.py. have @ docs here


Comments