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:
is settings.py (below) set correctly?
do need set models match schema in imported database?
- 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
Post a Comment