Added to requirements and fixed logging
This commit is contained in:
parent
d4fbe2d27d
commit
9537943fa5
|
@ -1,3 +1,4 @@
|
|||
eventlet==0.30.1
|
||||
Flask==1.1.1
|
||||
flask-oidc==1.4.0
|
||||
Flask-Login==0.5.0
|
||||
|
|
|
@ -13,7 +13,7 @@ from flask_login import current_user, login_user, logout_user, LoginManager
|
|||
|
||||
|
||||
# Apoplication imports
|
||||
|
||||
from core.utils import Logger
|
||||
|
||||
|
||||
# Configs and 'init'
|
||||
|
@ -47,6 +47,7 @@ app.config.update({
|
|||
oidc = OpenIDConnect(app)
|
||||
login_manager = LoginManager(app)
|
||||
bcrypt = Bcrypt(app)
|
||||
logger = Logger().get_logger()
|
||||
|
||||
|
||||
def oidc_loggedin():
|
||||
|
|
|
@ -6,9 +6,12 @@ import os, logging
|
|||
|
||||
class Logger:
|
||||
def __init__(self):
|
||||
pass
|
||||
self.logger = self.create_logger("flask_app")
|
||||
|
||||
def get_logger(self, loggerName = "NO_LOGGER_NAME_PASSED", createFile = True):
|
||||
def get_logger(self):
|
||||
return self.logger
|
||||
|
||||
def create_logger(self, loggerName = "NO_LOGGER_NAME_PASSED", createFile = True):
|
||||
"""
|
||||
Create a new logging object and return it.
|
||||
:note:
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
function main() {
|
||||
SCRIPTPATH="$( cd "$(dirname "")" >/dev/null 2>&1 ; pwd -P )"
|
||||
cd "${SCRIPTPATH}"
|
||||
echo "Working Dir: " $(pwd)
|
||||
source "../venv/bin/activate"
|
||||
|
||||
|
@ -20,8 +19,7 @@ function main() {
|
|||
# Note can replace 127.0.0.1 with 0.0.0.0 to make it 'network/internet' accessable...
|
||||
# Note: NEED -k eventlet for this to work! I spent too many hours on this...
|
||||
# <module>:<app> IE <file>:<flask app variable>
|
||||
gunicorn wsgi:app -p app.pid \
|
||||
-b $ADDR:$PORT \
|
||||
gunicorn wsgi:app -p app.pid -b $ADDR:$PORT \
|
||||
-k eventlet \
|
||||
-w $WORKER_COUNT \
|
||||
--timeout $TIMEOUT \
|
||||
|
|
|
@ -7,9 +7,18 @@
|
|||
|
||||
function main() {
|
||||
SCRIPTPATH="$( cd "$(dirname "")" >/dev/null 2>&1 ; pwd -P )"
|
||||
cd "${SCRIPTPATH}"
|
||||
echo "Working Dir: " $(pwd)
|
||||
source "../venv/bin/activate"
|
||||
gunicorn --bind unix:/tmp/app.sock wsgi:app -p app.pid
|
||||
|
||||
LOG_LEVEL=debug
|
||||
WORKER_COUNT=1
|
||||
TIMEOUT=120
|
||||
|
||||
# <module>:<app> IE <file>:<flask app variable>
|
||||
gunicorn wsgi:app -p app.pid -b unix:/tmp/app.sock \
|
||||
-k eventlet \
|
||||
-w $WORKER_COUNT \
|
||||
--timeout $TIMEOUT \
|
||||
--log-level $LOG_LEVEL
|
||||
}
|
||||
main $@;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
eventlet==0.30.1
|
||||
Flask==1.1.1
|
||||
flask-oidc==1.4.0
|
||||
Flask-Login==0.5.0
|
||||
|
|
Loading…
Reference in New Issue