Cambio de rutas en cache de sesiones

This commit is contained in:
Mauricio Baeza 2018-01-11 10:20:55 -06:00
parent 8642769580
commit 04fda8b9a2
3 changed files with 13 additions and 4 deletions

3
.gitignore vendored
View File

@ -12,9 +12,10 @@ source/fixtures
source/media
# Sphinx documentation
docs/
*.xlsx
docs/
cache/
credenciales.conf
*.sqlite
*.sql

View File

@ -20,6 +20,9 @@ from controllers.main import (AppEmpresas,
)
from settings import PATH_SESSIONS
db = StorageEngine()
api = falcon.API(middleware=[
@ -54,13 +57,12 @@ api.add_route('/movbanco', AppMovimientosBanco(db))
# ~ Activa si usas waitress y NO estas usando servidor web
# ~ api.add_sink(static, '/static')
session_options = {
'session.type': 'file',
'session.cookie_expires': True,
'session.httponly': True,
'session.data_dir': '/tmp/cache/data',
'session.lock_dir': '/tmp/cache/lock',
'session.data_dir': PATH_SESSIONS['data'],
'session.lock_dir': PATH_SESSIONS['lock'],
}
app = SessionMiddleware(api, session_options)

View File

@ -25,6 +25,7 @@ VERSION = '1.2.0'
EMAIL_SUPPORT = ('soporte@empresalibre.net',)
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
PATH_STATIC = os.path.abspath(os.path.join(BASE_DIR, '..'))
PATH_TEMPLATES = os.path.abspath(os.path.join(BASE_DIR, '..', 'templates'))
PATH_MEDIA = os.path.abspath(os.path.join(BASE_DIR, '..', 'docs'))
@ -33,6 +34,11 @@ PATH_CP = os.path.abspath(os.path.join(BASE_DIR, '..', 'db', 'cp.db'))
COMPANIES = os.path.abspath(os.path.join(BASE_DIR, '..', 'db', 'rfc.db'))
DB_SAT = os.path.abspath(os.path.join(BASE_DIR, '..', 'db', 'sat.db'))
PATH_SESSIONS = {
'data': os.path.abspath(os.path.join(BASE_DIR, '..', 'cache', 'data')),
'lock': os.path.abspath(os.path.join(BASE_DIR, '..', 'cache', 'lock')),
}
IV = 'valores_iniciales.json'
INIT_VALUES = os.path.abspath(os.path.join(BASE_DIR, '..', 'db', IV))
CT = 'cancel_template.xml'