def __init__(self): myHostname = os.environ['CUSTOMCONNSTR_REDIS_CACHE_HOSTNAME'] myPassword = os.environ['CUSTOMCONNSTR_REDIS_CACHE_PRIMARY_KEY'] port = 6380 sslEnabledPort = True db=0 self.redisCxn = redis.StrictRedis(host=myHostname, port=port, password=myPassword, db=db, ssl=sslEnabledPort, socket_timeout=None, decode_responses=True) self.flaskSessionManager = flaskManager.FlaskSessionManager() self.EnabledRounds = "_EnabledRounds" self.RoundResults = "_RoundResults" self.TeamsKey = "_teams" self.Enabled = "Enabled" self.Disabled = "Disabled" self.AnswerKey = "_AnswerKey" self.WordDelimiter = "]::[" self.LineDelimeter = "(\n)" self.CountdownClock = "_CountdownClock" self.RegisterTeamForNextWeek = "_RegisterTeamForNextWeek"
from flask import Blueprint, render_template, session, url_for, redirect, request, send_file, send_from_directory import redisCacheManager import flaskSessionManager import TownHallTriviaApp.admin.autoGrader as autoGraderClass from TownHallTriviaApp.admin.zipFileManagement import zipFileManagement import os, csv import json from datetime import datetime, timedelta admin = Blueprint("admin", __name__, template_folder="templates", static_folder="") redisManager = redisCacheManager.RedisClass() sessionManager = flaskSessionManager.FlaskSessionManager() autoGrader = autoGraderClass.autoGraderClass(admin.static_folder) @admin.route('/') def adminLogin(): sessionManager.toggleAdminLoggedInState(False) sessionManager.removeAdminGame() return render_template('admin/adminLogin.html')