static file issue, otherwise working
This commit is contained in:
@@ -66,36 +66,36 @@ STATIC_ROOT = BASE_DIR + "/static/"
|
||||
|
||||
|
||||
|
||||
logfile = usersettings["LOGFOLDER"] + "django.log"
|
||||
LOGGING = {
|
||||
"version": 1,
|
||||
"disable_existing_loggers": False,
|
||||
"root": {"level": "INFO", "handlers": ["file"]},
|
||||
"handlers": {
|
||||
"file": {
|
||||
"level": "INFO",
|
||||
"class": "logging.FileHandler",
|
||||
"filename": logfile,
|
||||
"formatter": "app",
|
||||
},
|
||||
},
|
||||
"loggers": {
|
||||
"django": {
|
||||
"handlers": ["file"],
|
||||
"level": "INFO",
|
||||
"propagate": True
|
||||
},
|
||||
},
|
||||
"formatters": {
|
||||
"app": {
|
||||
"format": (
|
||||
u"%(asctime)s [%(levelname)-8s] "
|
||||
"(%(module)s.%(funcName)s) %(message)s"
|
||||
),
|
||||
"datefmt": "%Y-%m-%d %H:%M:%S",
|
||||
},
|
||||
},
|
||||
}
|
||||
# logfile = usersettings["LOGFOLDER"] + "django.log"
|
||||
# LOGGING = {
|
||||
# "version": 1,
|
||||
# "disable_existing_loggers": False,
|
||||
# "root": {"level": "INFO", "handlers": ["file"]},
|
||||
# "handlers": {
|
||||
# "file": {
|
||||
# "level": "INFO",
|
||||
# "class": "logging.FileHandler",
|
||||
# "filename": logfile,
|
||||
# "formatter": "app",
|
||||
# },
|
||||
# },
|
||||
# "loggers": {
|
||||
# "django": {
|
||||
# "handlers": ["file"],
|
||||
# "level": "INFO",
|
||||
# "propagate": True
|
||||
# },
|
||||
# },
|
||||
# "formatters": {
|
||||
# "app": {
|
||||
# "format": (
|
||||
# u"%(asctime)s [%(levelname)-8s] "
|
||||
# "(%(module)s.%(funcName)s) %(message)s"
|
||||
# ),
|
||||
# "datefmt": "%Y-%m-%d %H:%M:%S",
|
||||
# },
|
||||
# },
|
||||
# }
|
||||
|
||||
|
||||
## ##
|
||||
@@ -140,6 +140,7 @@ INSTALLED_APPS = [
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
"library",
|
||||
"django_extensions"
|
||||
# "silk", # DEBUG/profilling purposes
|
||||
# 'debug_toolbar', # DEBUG purposes
|
||||
]
|
||||
|
@@ -1,33 +0,0 @@
|
||||
import multiprocessing
|
||||
import os
|
||||
import json
|
||||
|
||||
bind = "127.0.0.1:8000"
|
||||
workers = multiprocessing.cpu_count() * 2 + 1
|
||||
preload_app = True # By preloading an application you can save some RAM resources as well as speed up server boot times
|
||||
keepalive = 5
|
||||
# daemon = True # Detaches the server from the controlling terminal and enters the background. disabled for now
|
||||
# logging
|
||||
|
||||
with open("settings.json", "r") as jfile:
|
||||
settings = json.load(jfile)
|
||||
|
||||
errorlog = settings["LOGFOLDER"] + "/gunicorn_error.log"
|
||||
loglevel = "warning"
|
||||
accesslog = settings["LOGFOLDER"] + "/gunicorn_access.log"
|
||||
|
||||
if not os.path.isdir("/usr/src/app/data/logs"):
|
||||
os.mkdir("/usr/src/app/data/logs")
|
||||
if not os.path.isfile(errorlog):
|
||||
os.system('touch {}'.format(errorlog))
|
||||
if not os.path.isfile(accesslog):
|
||||
os.system('touch {}'.format(accesslog))
|
||||
capture_output = True
|
||||
|
||||
# debug settings which need to be commented out in prod
|
||||
# reload=True
|
||||
# reload_engine = "inotify"
|
||||
|
||||
|
||||
# I only went till the section https://docs.gunicorn.org/en/latest/settings.html#logging there are more settings
|
||||
# some of them might be useful
|
Reference in New Issue
Block a user