Commit 1408eb8b authored by Lukas Burgey's avatar Lukas Burgey

Update example settings and install script

parent 408913b5
...@@ -139,7 +139,7 @@ AUTH_PASSWORD_VALIDATORS = [ ...@@ -139,7 +139,7 @@ AUTH_PASSWORD_VALIDATORS = [
LANGUAGE_CODE = 'en-us' LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC' TIME_ZONE = 'Europe/Berlin'
USE_I18N = True USE_I18N = True
...@@ -157,6 +157,9 @@ LOGGING = { ...@@ -157,6 +157,9 @@ LOGGING = {
'standard': { 'standard': {
'format': '%(asctime)s - %(name)s - %(levelname)s - %(message)s', 'format': '%(asctime)s - %(name)s - %(levelname)s - %(message)s',
}, },
'compact': {
'format': '%(levelname)s - %(message)s',
},
}, },
'handlers': { 'handlers': {
'django': { 'django': {
...@@ -170,6 +173,12 @@ LOGGING = { ...@@ -170,6 +173,12 @@ LOGGING = {
'filename': LOGGING_ROOT + '/debug.log', 'filename': LOGGING_ROOT + '/debug.log',
'formatter': 'standard', 'formatter': 'standard',
}, },
'compact-debug': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': LOGGING_ROOT + '/compact-debug.log',
'formatter': 'compact',
},
'info': { 'info': {
'level': 'INFO', 'level': 'INFO',
'class': 'logging.FileHandler', 'class': 'logging.FileHandler',
...@@ -189,11 +198,11 @@ LOGGING = { ...@@ -189,11 +198,11 @@ LOGGING = {
}, },
'loggers': { 'loggers': {
'feudal': { 'feudal': {
'handlers': ['debug', 'info', 'error'], 'handlers': ['debug', 'info', 'error', 'compact-debug'],
'level': 'DEBUG', 'level': 'DEBUG',
}, },
'django': { 'django': {
'handlers': ['debug', 'info', 'error'], 'handlers': ['debug', 'info', 'error', 'compact-debug'],
'level': 'INFO', 'level': 'INFO',
}, },
}, },
......
...@@ -16,9 +16,11 @@ master = true ...@@ -16,9 +16,11 @@ master = true
# maximum number of worker processes # maximum number of worker processes
processes = 1 processes = 1
# the socket (use the full path to be safe # the socket (use the full path to be safe
socket = /home/feudal/feudalBackend/feudal.sock socket = /home/feudal/.feudal.sock
# ... with appropriate permissions - may be needed # ... with appropriate permissions - may be needed
chmod-socket = 666 chmod-socket = 666
# clear environment on exit # clear environment on exit
vacuum = true vacuum = true
logto = /home/feudal/logs/uwsgi.log
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
config_dir=${config_dir-~/config} config_dir=${config_dir-~/config}
logs_dir=${logs_dir-~/logs} logs_dir=${logs_dir-~/logs}
secret_key=${secret_key-./.secret.key}
echo "Using config dir: $config_dir" echo "Using config dir: $config_dir"
echo "Using logs dir: $logs_dir" echo "Using logs dir: $logs_dir"
...@@ -15,14 +16,15 @@ ln -s $config_dir/django_settings.py ./feudal/settings.py ...@@ -15,14 +16,15 @@ ln -s $config_dir/django_settings.py ./feudal/settings.py
echo echo
echo "Generating secret at ./.secret.key" echo "Generating secret at ./.secret.key"
dd if=/dev/urandom bs=64 count=1 | base64 > ./.secret.key [[ ! -f $secret_key ]] && \
dd if=/dev/urandom bs=64 count=1 | base64 > $secret_key
echo echo
virtualenv -p /usr/bin/python3 ./env virtualenv -p /usr/bin/python3 ./env
source env/bin/activate source env/bin/activate
# TODO check dependencies # TODO check dependencies
pip install Django django-cors-headers django-mysql djangorestframework oic urllib3 mysqlclient pika pip install Django django-cors-headers djangorestframework django-mysql mysqlclient oic urllib3 pika
echo "Starting database migration (is your database configured?)" echo "Starting database migration (is your database configured?)"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment