eric-wieser / caius-rooms

The room balloting and information system for gonville and caius college
http://roompicks.caiusjcr.co.uk/
4 stars 1 forks source link

Make a standalone dev install easier #14

Open eric-wieser opened 9 years ago

eric-wieser commented 9 years ago

Document how to get a dev setup...

import os

from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker

def makeSQLLite():
    base_dir = os.path.dirname(__file__)
    engine = create_engine('sqlite:///{}'.format(os.path.join(base_dir, 'dev.db')))

    # fix foreign keys in SQLite
    from sqlalchemy import event

    @event.listens_for(engine, "connect")
    def set_sqlite_pragma(dbapi_connection, connection_record):
        cursor = dbapi_connection.cursor()
        cursor.execute("PRAGMA foreign_keys=ON")
        cursor.close()

    return engine
eric-wieser commented 9 years ago

Seems like the best way to go is to install postgresql on the local machine, and use pgAdmin III to add some initial data