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 source/media
# Sphinx documentation # Sphinx documentation
docs/
*.xlsx *.xlsx
docs/
cache/
credenciales.conf credenciales.conf
*.sqlite *.sqlite
*.sql *.sql

View File

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

View File

@ -25,6 +25,7 @@ VERSION = '1.2.0'
EMAIL_SUPPORT = ('soporte@empresalibre.net',) EMAIL_SUPPORT = ('soporte@empresalibre.net',)
BASE_DIR = os.path.abspath(os.path.dirname(__file__)) BASE_DIR = os.path.abspath(os.path.dirname(__file__))
PATH_STATIC = os.path.abspath(os.path.join(BASE_DIR, '..')) PATH_STATIC = os.path.abspath(os.path.join(BASE_DIR, '..'))
PATH_TEMPLATES = os.path.abspath(os.path.join(BASE_DIR, '..', 'templates')) PATH_TEMPLATES = os.path.abspath(os.path.join(BASE_DIR, '..', 'templates'))
PATH_MEDIA = os.path.abspath(os.path.join(BASE_DIR, '..', 'docs')) 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')) 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')) 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' IV = 'valores_iniciales.json'
INIT_VALUES = os.path.abspath(os.path.join(BASE_DIR, '..', 'db', IV)) INIT_VALUES = os.path.abspath(os.path.join(BASE_DIR, '..', 'db', IV))
CT = 'cancel_template.xml' CT = 'cancel_template.xml'