Skip to content

Commit

Permalink
Add schematic to requirements.txt and create schematic_settings.py
Browse files Browse the repository at this point in the history
  • Loading branch information
James Socol committed May 4, 2010
1 parent 12fb86b commit 766608d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
29 changes: 29 additions & 0 deletions migrations/schematic_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import sys
import os

sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

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'
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Jinja2==2.2.1
-e git://github.com/jbalogh/jingo.git@c73d2c55182301e6f3ce507fc9a17ea843fed24f#egg=jingo
-e git://github.com/jsocol/jingo-minify.git#egg=jingo-minify
-e git://github.com/jsocol/bleach.git#egg=bleach
-e git://github.com/jbalogh/schematic.git#egg=schematic

GitPython==0.1.7
MySQL-python==1.2.3c1
Expand Down

0 comments on commit 766608d

Please sign in to comment.