source: cows_wps/trunk/cows_wps/model/session.py @ 7115

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/cows_wps/trunk/cows_wps/model/session.py@7115
Revision 7115, 553 bytes checked in by astephen, 10 years ago (diff)

more work on admin interface etc.

Line 
1"""
2This module provides access to a SQLAlchemy engine and sessionmaker corresponding to the database
3detailed in the wps_config_dict.
4"""
5
6from sqlalchemy import create_engine
7from sqlalchemy.orm import sessionmaker
8
9import logging
10log = logging.getLogger(__name__)
11
12from cows_wps.utils.parse_wps_config import wps_config_dict
13
14db_url = wps_config_dict['database_url']
15#db_url = "postgresql://ceda_wps:wasp_ced@bora/ceda_wps_test"
16log.info('Initialising database engine %s' % db_url)
17engine = create_engine(db_url)
18Session = sessionmaker(bind=engine)
Note: See TracBrowser for help on using the repository browser.