These are my working settings for a postgress database on heroku, after they removed automatic inyection of the values.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | import urlparse
url = urlparse.urlparse(os.environ['DATABASE_URL'])
path = url.path[1:]
path = path.split('?', 2)[0]
DATABASES = {'default': {'ENGINE': 'django.db.backends.postgresql_psycopg2',
'HOST': url.hostname,
'NAME': path,
'OPTIONS': {},
'PASSWORD': url.password,
'PORT': url.port,
'TEST_CHARSET': None,
'TEST_COLLATION': None,
'TEST_MIRROR': None,
'TEST_NAME': None,
'TIME_ZONE': 'America/Mexico_City',
'USER': url.username}}
|
More like this
- FileField having auto upload_to path by junaidmgithub 1 month ago
- LazyPrimaryKeyRelatedField by LLyaudet 1 month, 1 week ago
- CacheInDictManager by LLyaudet 1 month, 1 week ago
- MYSQL Full Text Expression by Bidaya0 1 month, 1 week ago
- Custom model manager chaining (Python 3 re-write) by Spotted1270 1 month, 2 weeks ago
Comments
Please login first before commenting.