Skip to content

Instantly share code, notes, and snippets.

@atlasloewenherz
Forked from gipi/local_settings.py
Created January 21, 2014 23:50
Show Gist options
  • Save atlasloewenherz/8550904 to your computer and use it in GitHub Desktop.
Save atlasloewenherz/8550904 to your computer and use it in GitHub Desktop.
# Since we need a syncdb on all the databases, before the tests can be
# runned successfully we need to execute
#
# $ python manage.py syncdb
# $ python manage.py syncdb --database=test
#
# otherwise will be errors like
#
# 'django.db.utils.DatabaseError: no such table: django_site'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'bla',
'USER': 'foo'
'PASSWORD': 'bar'
},
'test': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'only4test.sqlite'
},
}
# http://stackoverflow.com/questions/4650509/different-db-for-testing-in-django
import sys
if 'test' in sys.argv:
DATABASES['default'] = DATABASES['test'];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment