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==1.1.1
|
||||||
flask-oidc==1.4.0
|
flask-oidc==1.4.0
|
||||||
Flask-Login==0.5.0
|
Flask-Login==0.5.0
|
||||||
|
|
|
@ -13,7 +13,7 @@ from flask_login import current_user, login_user, logout_user, LoginManager
|
||||||
|
|
||||||
|
|
||||||
# Apoplication imports
|
# Apoplication imports
|
||||||
|
from core.utils import Logger
|
||||||
|
|
||||||
|
|
||||||
# Configs and 'init'
|
# Configs and 'init'
|
||||||
|
@ -47,6 +47,7 @@ app.config.update({
|
||||||
oidc = OpenIDConnect(app)
|
oidc = OpenIDConnect(app)
|
||||||
login_manager = LoginManager(app)
|
login_manager = LoginManager(app)
|
||||||
bcrypt = Bcrypt(app)
|
bcrypt = Bcrypt(app)
|
||||||
|
logger = Logger().get_logger()
|
||||||
|
|
||||||
|
|
||||||
def oidc_loggedin():
|
def oidc_loggedin():
|
||||||
|
|
|
@ -6,9 +6,12 @@ import os, logging
|
||||||
|
|
||||||
class Logger:
|
class Logger:
|
||||||
def __init__(self):
|
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.
|
Create a new logging object and return it.
|
||||||
:note:
|
:note:
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
SCRIPTPATH="$( cd "$(dirname "")" >/dev/null 2>&1 ; pwd -P )"
|
SCRIPTPATH="$( cd "$(dirname "")" >/dev/null 2>&1 ; pwd -P )"
|
||||||
cd "${SCRIPTPATH}"
|
|
||||||
echo "Working Dir: " $(pwd)
|
echo "Working Dir: " $(pwd)
|
||||||
source "../venv/bin/activate"
|
source "../venv/bin/activate"
|
||||||
|
|
||||||
|
@ -20,11 +19,10 @@ function main() {
|
||||||
# Note can replace 127.0.0.1 with 0.0.0.0 to make it 'network/internet' accessable...
|
# 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...
|
# Note: NEED -k eventlet for this to work! I spent too many hours on this...
|
||||||
# <module>:<app> IE <file>:<flask app variable>
|
# <module>:<app> IE <file>:<flask app variable>
|
||||||
gunicorn wsgi:app -p app.pid \
|
gunicorn wsgi:app -p app.pid -b $ADDR:$PORT \
|
||||||
-b $ADDR:$PORT \
|
-k eventlet \
|
||||||
-k eventlet \
|
-w $WORKER_COUNT \
|
||||||
-w $WORKER_COUNT \
|
--timeout $TIMEOUT \
|
||||||
--timeout $TIMEOUT \
|
--log-level $LOG_LEVEL
|
||||||
--log-level $LOG_LEVEL
|
|
||||||
}
|
}
|
||||||
main $@;
|
main $@;
|
||||||
|
|
|
@ -7,9 +7,18 @@
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
SCRIPTPATH="$( cd "$(dirname "")" >/dev/null 2>&1 ; pwd -P )"
|
SCRIPTPATH="$( cd "$(dirname "")" >/dev/null 2>&1 ; pwd -P )"
|
||||||
cd "${SCRIPTPATH}"
|
|
||||||
echo "Working Dir: " $(pwd)
|
echo "Working Dir: " $(pwd)
|
||||||
source "../venv/bin/activate"
|
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 $@;
|
main $@;
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
eventlet==0.30.1
|
||||||
Flask==1.1.1
|
Flask==1.1.1
|
||||||
flask-oidc==1.4.0
|
flask-oidc==1.4.0
|
||||||
Flask-Login==0.5.0
|
Flask-Login==0.5.0
|
||||||
|
@ -7,4 +8,4 @@ Flask-WTF==0.14.3
|
||||||
waitress==1.4.3
|
waitress==1.4.3
|
||||||
SQLAlchemy==1.3.11
|
SQLAlchemy==1.3.11
|
||||||
Werkzeug==0.16.0
|
Werkzeug==0.16.0
|
||||||
WTForms==2.2.1
|
WTForms==2.2.1
|
||||||
|
|
Loading…
Reference in New Issue