Commit 677b112a authored by Nicolas Joyard's avatar Nicolas Joyard

Use pgsql on CI

parent f6a4020a
sudo: false
env:
- DJANGO_DEBUG=True DJANGO_SETTINGS_MODULE=memopol.settings
global:
- DJANGO_DEBUG=True
- DJANGO_SETTINGS_MODULE=memopol.settings
- MEMOPOL_DB_NAME=memopol
- MEMOPOL_DB_USER=memopol
- MEMOPOL_DB_PASSWORD=memopol
- MEMOPOL_DB_HOST=localhost
- MEMOPOL_DB_PORT=5432
- MEMOPOL_DB_ENGINE=django.db.backends.postgresql_psycopg2
language: python
python:
- '2.7'
services:
- postgresql
install:
- pip install -e .[testing]
before_script:
- bin/install_client_deps.sh
- psql -c "CREATE USER memopol WITH CREATEDB PASSWORD 'memopol';" -U postgres
- psql -c "CREATE DATABASE memopol WITH OWNER memopol;" -U postgres
script:
- flake8 . --exclude '*/migrations,docs,static' --ignore E128
- py.test memopol representatives_positions representatives_recommendations
......
......@@ -125,20 +125,16 @@ WSGI_APPLICATION = 'memopol.wsgi.application'
DATABASES = {
'default': {
'NAME': os.environ.get('DJANGO_DATABASE_DEFAULT_NAME', 'db.sqlite'),
'USER': os.environ.get('DJANGO_DATABASE_DEFAULT_USER', ''),
'PASSWORD': os.environ.get('DJANGO_DATABASE_DEFAULT_PASSWORD', ''),
'HOST': os.environ.get('DJANGO_DATABASE_DEFAULT_HOST', ''),
'PORT': os.environ.get('DJANGO_DATABASE_DEFAULT_PORT', ''),
'ENGINE': os.environ.get('DJANGO_DATABASE_DEFAULT_ENGINE',
'django.db.backends.sqlite3'),
'NAME': os.environ.get('MEMOPOL_DB_NAME', 'memopol'),
'USER': os.environ.get('MEMOPOL_DB_USER', 'memopol'),
'PASSWORD': os.environ.get('MEMOPOL_DB_PASSWORD', 'memopol'),
'HOST': os.environ.get('MEMOPOL_DB_HOST', 'localhost'),
'PORT': os.environ.get('MEMOPOL_DB_PORT', '5432'),
'ENGINE': os.environ.get('MEMOPOL_DB_ENGINE',
'django.db.backends.postgresql_psycopg2'),
}
}
if 'OPENSHIFT_DATA_DIR' in os.environ:
DATABASES['default']['NAME'] = os.path.join(DATA_DIR, 'db.sqlite')
if 'OPENSHIFT_POSTGRESQL_DB_HOST' in os.environ:
DATABASES['default']['NAME'] = os.environ['OPENSHIFT_APP_NAME']
DATABASES['default']['USER'] = os.environ[
......@@ -147,7 +143,6 @@ if 'OPENSHIFT_POSTGRESQL_DB_HOST' in os.environ:
'OPENSHIFT_POSTGRESQL_DB_PASSWORD']
DATABASES['default']['HOST'] = os.environ['OPENSHIFT_POSTGRESQL_DB_HOST']
DATABASES['default']['PORT'] = os.environ['OPENSHIFT_POSTGRESQL_DB_PORT']
DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql_psycopg2'
# Internationalization
# https://docs.djangoproject.com/en/1.7/topics/i18n/
......
......@@ -28,6 +28,7 @@ setup(name='political-memory',
'pytz', # Always use up-to-date TZ data
'django-suit>=0.2,<0.3',
'sqlparse>=0.1,<0.2',
'psycopg2>=2,<3',
],
extras_require={
# Full version hardcode for testing dependencies so that
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment