Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (23 sloc) 0.679 kb
import sys
import os
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
# Set up playdoh.
import manage
from django.conf import settings
config = settings.DATABASES['default']
config['HOST'] = config.get('HOST', 'localhost')
config['PORT'] = config.get('PORT', '3306')
if not config['HOST'] or config['HOST'].endswith('.sock'):
"""Oh, you meant 'localhost'!"""
config['HOST'] = 'localhost'
s = 'mysql --silent {NAME} -h{HOST} -u{USER}'
if config['PASSWORD']:
s += ' -p{PASSWORD}'
else:
del config['PASSWORD']
if config['PORT']:
s += ' -P{PORT}'
else:
del config['PORT']
db = s.format(**config)
table = 'schema_version'
Jump to Line
Something went wrong with that request. Please try again.