Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
RECIRCLE
/
portal
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
11
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2772d615
authored
Jul 15, 2019
by
Chif Gergő
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create separate setting files. Add basic logging
parent
ee5bcf00
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
6 deletions
+70
-6
environment.sh.example
+2
-2
recircle/manage.py
+1
-1
recircle/recircle/settings/__init__.py
+0
-0
recircle/recircle/settings/base.py
+54
-3
recircle/recircle/settings/local.py
+13
-0
No files found.
environment.sh.example
View file @
2772d615
export DJANGO_SECRET = "very very secret key"
export OS_AUTH_URL=http://example/identity/v3
export OS_PROJECT_ID=123456789
export OS_PROJECT_NAME="example"
...
...
@@ -8,4 +9,4 @@ export OS_USERNAME="example"
export OS_PASSWORD=secret
export OS_REGION_NAME="example"
export OS_INTERFACE="example"
export OS_IDENTITY_API_VERSION=123
\ No newline at end of file
export OS_IDENTITY_API_VERSION=123
recircle/manage.py
View file @
2772d615
...
...
@@ -3,7 +3,7 @@ import os
import
sys
if
__name__
==
"__main__"
:
os
.
environ
.
setdefault
(
"DJANGO_SETTINGS_MODULE"
,
"recircle.settings"
)
os
.
environ
.
setdefault
(
"DJANGO_SETTINGS_MODULE"
,
"recircle.settings
.local
"
)
try
:
from
django.core.management
import
execute_from_command_line
except
ImportError
as
exc
:
...
...
recircle/recircle/settings/__init__.py
0 → 100644
View file @
2772d615
recircle/recircle/settings.py
→
recircle/recircle/settings
/base
.py
View file @
2772d615
...
...
@@ -30,8 +30,6 @@ ALLOWED_HOSTS = ["vm.niif.cloud.bme.hu", "localhost"]
# Application definition
INSTALLED_APPS
=
[
"instance.apps.InstanceConfig"
,
"image.apps.ImageConfig"
,
"django.contrib.admin"
,
"django.contrib.auth"
,
"django.contrib.contenttypes"
,
...
...
@@ -42,9 +40,17 @@ INSTALLED_APPS = [
"djoser"
,
"rest_framework_swagger"
,
"corsheaders"
,
"template"
]
LOCAL_APPS
=
[
"image"
,
"instance"
,
"storage"
,
"template"
,
]
INSTALLED_APPS
+=
LOCAL_APPS
MIDDLEWARE
=
[
"django.middleware.security.SecurityMiddleware"
,
"django.contrib.sessions.middleware.SessionMiddleware"
,
...
...
@@ -172,3 +178,48 @@ CONNECTION = {
"interface"
:
os
.
getenv
(
"OS_INTERFACE"
),
"identity_api_version"
:
os
.
getenv
(
"OS_IDENTITY_API_VERSION"
),
}
# LOGGING = {
# 'version': 1,
# 'disable_existing_loggers': False,
# 'handlers': {
# 'file': {
# 'level': 'DEBUG',
# 'class': 'logging.FileHandler',
# 'filename': '/recircle/logs/django/debug.log',
# },
# },
# 'loggers': {
# 'django': {
# 'handlers': ['file'],
# 'level': 'DEBUG',
# 'propagate': True,
# },
# },
# }
LOGGING
=
{
'version'
:
1
,
'disable_existing_loggers'
:
False
,
'formatters'
:
{
'simple'
:
{
'format'
:
'
%(asctime)
s [
%(levelname)
s]:
%(name)
s
%(message)
s'
,
'datefmt'
:
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
,
},
},
'handlers'
:
{
'console'
:
{
'class'
:
'logging.StreamHandler'
,
'formatter'
:
'simple'
,
},
},
'loggers'
:
{
'django'
:
{
'handlers'
:
[
'console'
],
'level'
:
os
.
getenv
(
'DJANGO_LOG_LEVEL'
,
'INFO'
),
},
},
}
for
i
in
LOCAL_APPS
:
LOGGING
[
'loggers'
][
i
]
=
{
'handlers'
:
[
'console'
],
'level'
:
'DEBUG'
}
recircle/recircle/settings/local.py
0 → 100644
View file @
2772d615
from
.base
import
*
DEBUG
=
True
# CORS config for development version only
CORS_ORIGIN_WHITELIST
=
(
"http://localhost:3000"
,)
for
i
in
LOCAL_APPS
:
LOGGING
[
'loggers'
][
i
]
=
{
'handlers'
:
[
'console'
],
'level'
:
'DEBUG'
}
ADMIN_ENABLED
=
True
ALLOWED_HOSTS
=
[
'*'
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment