Fix sessions for PostgreSQL backend
This commit is contained in:
parent
51594687e2
commit
b6c0170748
@ -70,7 +70,7 @@ if app.config['DB_TYPE'] == 'mongodb':
|
|||||||
app.config['SESSION_MONGODB_DB'] = dbinfo.provider.db_name
|
app.config['SESSION_MONGODB_DB'] = dbinfo.provider.db_name
|
||||||
elif app.config['DB_TYPE'] == 'postgresql':
|
elif app.config['DB_TYPE'] == 'postgresql':
|
||||||
app.config['SESSION_TYPE'] = 'sqlalchemy'
|
app.config['SESSION_TYPE'] = 'sqlalchemy'
|
||||||
app.config['SQLALCHEMY_DATABASE_URI'] = dbinfo.provider.conn.dsn
|
app.config['SQLALCHEMY_DATABASE_URI'] = app.config['DB_URI'] + app.config['DB_NAME']
|
||||||
flask_session.Session(app)
|
flask_session.Session(app)
|
||||||
|
|
||||||
# Set configs
|
# Set configs
|
||||||
@ -115,6 +115,11 @@ def run_tests(prefix, lang):
|
|||||||
import eos.tests
|
import eos.tests
|
||||||
eos.tests.run_tests(prefix, lang)
|
eos.tests.run_tests(prefix, lang)
|
||||||
|
|
||||||
|
# Create the session databases (SQL only)
|
||||||
|
@app.cli.command('sessdb')
|
||||||
|
def sessdb():
|
||||||
|
app.session_interface.db.create_all()
|
||||||
|
|
||||||
# TODO: Will remove this once we have a web UI
|
# TODO: Will remove this once we have a web UI
|
||||||
@app.cli.command('drop_db_and_setup')
|
@app.cli.command('drop_db_and_setup')
|
||||||
def setup_test_election():
|
def setup_test_election():
|
||||||
|
@ -3,6 +3,7 @@ Flask==0.12.2
|
|||||||
Flask-Mail==0.9.1
|
Flask-Mail==0.9.1
|
||||||
Flask-OAuthlib==0.9.4
|
Flask-OAuthlib==0.9.4
|
||||||
Flask-Session==0.3.1
|
Flask-Session==0.3.1
|
||||||
|
Flask-SQLAlchemy==2.3.2
|
||||||
gunicorn==19.7.1
|
gunicorn==19.7.1
|
||||||
libsass==0.13.4
|
libsass==0.13.4
|
||||||
premailer==3.1.1
|
premailer==3.1.1
|
||||||
|
Loading…
Reference in New Issue
Block a user