UNKNOWN
Project description
Flask SQLAlchemy Session
========================
This is a Database Session storage interface for Flask with SQLAlchemy
How to use
----------
First you will have to create the sessions table
::
CREATE TABLE sessions (
session_id CHAR(129) UNIQUE NOT NULL,
atime TIMESTAMP,
data TEXT);
Then you will have to connect the interface to your Flask application ::
from FlaskSQLAlchemySession import set_db_session_interface
application.config['SQLALCHEMY_DATABASE_URI'] = "[your-sqlalchemy-db-uri]"
set_db_session_interface(application)
By default, the data is stored using pickle module, but you can pass other data serializer like JSON module ::
import json
from FlaskSQLAlchemySession import set_db_session_interface
application.config['SQLALCHEMY_DATABASE_URI'] = "[your-sqlalchemy-db-uri]"
set_db_session_interface(application, data_serializer=json)
Requirements
------------
* Flask
* Flask-SQLAlchemy
========================
This is a Database Session storage interface for Flask with SQLAlchemy
How to use
----------
First you will have to create the sessions table
::
CREATE TABLE sessions (
session_id CHAR(129) UNIQUE NOT NULL,
atime TIMESTAMP,
data TEXT);
Then you will have to connect the interface to your Flask application ::
from FlaskSQLAlchemySession import set_db_session_interface
application.config['SQLALCHEMY_DATABASE_URI'] = "[your-sqlalchemy-db-uri]"
set_db_session_interface(application)
By default, the data is stored using pickle module, but you can pass other data serializer like JSON module ::
import json
from FlaskSQLAlchemySession import set_db_session_interface
application.config['SQLALCHEMY_DATABASE_URI'] = "[your-sqlalchemy-db-uri]"
set_db_session_interface(application, data_serializer=json)
Requirements
------------
* Flask
* Flask-SQLAlchemy
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for Flask-SQLAlchemySession-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | eca2af7ebc32edbacac51c5eb02642ed48fa48e1a53d70c50ffbf790273a2e7e |
|
MD5 | 6d2e6087009b28c8b0830a791f9d00ae |
|
BLAKE2b-256 | e8f91d9f801508ffd8be2634f7502e63b0e6d74d814eeba1cc71d85b40de6435 |