Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
sso
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhanhua kuang
sso
Commits
6c68a051
Commit
6c68a051
authored
Mar 03, 2020
by
zkuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
logging to console
parent
79fd3913
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
19 deletions
+27
-19
settings.py
account/settings.py
+27
-19
No files found.
account/settings.py
View file @
6c68a051
...
...
@@ -12,6 +12,32 @@ https://docs.djangoproject.com/en/3.0/ref/settings/
import
os
import
json
import
logging.config
# LOGGING_CONFIG = None
LOGLEVEL
=
os
.
getenv
(
'DJANGO_LOGLEVEL'
,
'debug'
)
.
upper
()
logging
.
config
.
dictConfig
({
'version'
:
1
,
'disable_existing_loggers'
:
True
,
'formatters'
:
{
'console'
:
{
'format'
:
'
%(asctime)
s
%(levelname)
s [
%(name)
s:
%(lineno)
s]
%(module)
s
%(process)
d
%(thread)
d
%(message)
s'
,
},
},
'handlers'
:
{
'console'
:
{
'class'
:
'logging.StreamHandler'
,
'formatter'
:
'console'
,
},
},
'loggers'
:
{
''
:
{
'level'
:
LOGLEVEL
,
'handlers'
:
[
'console'
,]
},
},
})
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
...
...
@@ -24,7 +50,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY
=
os
.
environ
.
get
(
'SECRET_KEY'
)
# '1gboig1)_)ljuz_h0&8m%s84ybxz4*z!w0pu$0qi#mobo#poae'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG
=
Fals
e
DEBUG
=
Tru
e
ALLOWED_HOSTS
=
json
.
loads
(
os
.
environ
.
get
(
'ALLOWED_HOSTS'
))
# ['sso.gzego.com']
...
...
@@ -131,11 +157,6 @@ STATIC_ROOT = os.path.join(BASE_DIR, 'static')
MAMA_CAS_ENABLE_SINGLE_SIGN_OUT
=
True
# the service env variable is a json string like this:
# redirect_url logout_url redirect_url logout_url
# ["http://carbinet.gzego.com:8080/api/cas", "http://carbinet.gzego.com:8080/api/cas/logout", ".................", "................."]
#
def
make_service_config
(
redirect_url
,
logout_url
):
return
{
'SERVICE'
:
redirect_url
,
...
...
@@ -148,15 +169,3 @@ def make_service_config(redirect_url, logout_url):
service_urls
=
json
.
loads
(
os
.
environ
.
get
(
'CAS_SERVICES'
))
MAMA_CAS_SERVICES
=
[
make_service_config
(
redirect
,
logout
)
for
redirect
,
logout
in
zip
(
service_urls
[
0
::
2
],
service_urls
[
1
::
2
])]
# MAMA_CAS_SERVICES = [
# {
# 'SERVICE': 'http://carbinet.gzego.com:8080/api/cas',
# 'CALLBACKS': [
# 'mama_cas.callbacks.user_model_attributes',
# ],
# 'LOGOUT_ALLOW': True,
# 'LOGOUT_URL': 'http://carbinet.gzego.com:8080/api/cas/logout',
# },
# ]
\ No newline at end of file
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