forked from tulsawebdevs/django-multi-gtfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
t_overrides.example.py
32 lines (28 loc) · 1.28 KB
/
t_overrides.example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Copy to t_overrides.py, make changes
import os
def update(old_config):
config = old_config.copy()
if os.environ.get('MULTIGTFS_TEST_POSTGIS', False):
# Run tests under PostgreSQL / PostGIS
# Requires psycopg2:
# pip install psycopg2
# Requires the PostgreSQL role with SUPERUSER and CREATEDB permission
# createuser multigtfs --superuser --createdb --pwprompt
# Requires the PostgreSQL database w/ PostGIS extensions:
# createdb multigtfs --owner=multigtfs
# psql -d multigtfs -c "CREATE EXTENSION postgis"
# psql -d multigtfs -c "CREATE EXTENSION postgis_topology"
# Running the test creates a new database 'test_multigtfs'
# Because superuser permissions are needed, it is recommended that you
# only install on a local database, and change configuration items
# below.
config['DATABASE_ENGINE'] = 'django.contrib.gis.db.backends.postgis'
config['DATABASES'] = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'multigtfs',
'USER': 'multigtfs',
'PASSWORD': 'multigtfs',
'HOST': 'localhost',
'PORT': '5432'}}
return config