Skip to content

Instantly share code, notes, and snippets.

@pinge
Created February 2, 2017 22:13
Show Gist options
  • Save pinge/bf8d6ec01f3318893751a78ee3891527 to your computer and use it in GitHub Desktop.
Save pinge/bf8d6ec01f3318893751a78ee3891527 to your computer and use it in GitHub Desktop.
# coding: utf8
"""
from http://orator.readthedocs.io/en/latest/migrations.html
orator.py is the default migration configuration file for the Orator ORM
this file uses the Config class, so we've decided to use sys.path.append() method at runtime to avoid having to specify
the PYTHONPATH environment variable, making required command line a bit more user friendly
$ cd db
$ orator migrate:install
$ orator make:migration
$ orator migrate
"""
import os
import sys
sys.path.append(os.path.join(os.path.abspath(os.getcwd()), os.path.pardir, 'src'))
from config import config
DATABASES = {
'deployeth_api': {
'driver': config.get('data_stores.api.driver'),
'host': config.get('data_stores.api.host'),
'database': config.get('data_stores.api.database'),
'user': config.get('data_stores.api.user'),
'password': config.get('data_stores.api.password'),
'port': int(config.get('data_stores.api.port'))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment