aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-07-25 16:53:28 -0500
committerFrederick Muriuki Muriithi2024-07-26 16:45:31 -0500
commit365f360f0e79c761bd6fb9c26009b4f782f752eb (patch)
treeb3487d936b0d15fae760a9f6c74dc327bb425d36
parent7ec7146f64cb6634b84f295c5a15804d7f77451f (diff)
downloadgn-uploader-365f360f0e79c761bd6fb9c26009b4f782f752eb.tar.gz
Initialise sessions for the application.
-rw-r--r--uploader/__init__.py3
-rw-r--r--uploader/default_settings.py4
2 files changed, 7 insertions, 0 deletions
diff --git a/uploader/__init__.py b/uploader/__init__.py
index feffcae..a3b36e7 100644
--- a/uploader/__init__.py
+++ b/uploader/__init__.py
@@ -4,6 +4,7 @@ import logging
from pathlib import Path
from flask import Flask, request
+from flask_session import Session
from .entry import entrybp
from .upload import upload
@@ -41,6 +42,8 @@ def create_app():
# setup jinja2 symbols
app.add_template_global(lambda : request.url, name="request_url")
+ Session(app)
+
# setup blueprints
app.register_blueprint(base, url_prefix="/")
app.register_blueprint(entrybp, url_prefix="/")
diff --git a/uploader/default_settings.py b/uploader/default_settings.py
index 7a9da0f..3add7ef 100644
--- a/uploader/default_settings.py
+++ b/uploader/default_settings.py
@@ -12,3 +12,7 @@ REDIS_URL = "redis://"
JOBS_TTL_SECONDS = 1209600 # 14 days
GNQC_REDIS_PREFIX="GNQC"
SQL_URI = ""
+
+SESSION_TYPE = "redis"
+SESSION_PERMANENT = True
+SESSION_USE_SIGNER = True