Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
周伟奇
/
bmw-ocr
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
ddd5b3c9
authored
2022-06-09 20:06:48 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
jwt expiration time update
1 parent
9e9de181
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
src/settings/__init__.py
src/settings/conf/_default_config.py
src/settings/__init__.py
View file @
ddd5b3c
...
...
@@ -176,7 +176,8 @@ APPEND_SLASH = False
secret_key_md5
=
hashlib
.
md5
()
secret_key_md5
.
update
(
conf
.
JWT_SECRET_KEY
.
encode
(
'utf-8'
))
JWT_AUTH
=
{
'JWT_EXPIRATION_DELTA'
:
datetime
.
timedelta
(
days
=
conf
.
JWT_EXPIRATION_DAYS
),
# 'JWT_EXPIRATION_DELTA': datetime.timedelta(days=conf.JWT_EXPIRATION_DAYS),
'JWT_EXPIRATION_DELTA'
:
datetime
.
timedelta
(
minutes
=
conf
.
JWT_EXPIRATION_DAYS
),
'JWT_AUTH_HEADER_PREFIX'
:
'Bearer'
,
'JWT_SECRET_KEY'
:
secret_key_md5
.
hexdigest
(),
'JWT_ALGORITHM'
:
'HS256'
,
...
...
src/settings/conf/_default_config.py
View file @
ddd5b3c
...
...
@@ -20,4 +20,5 @@ LOG_DIR = os.path.join(os.path.dirname(BASE_DIR), 'logs')
ALLOWED_HOSTS
=
'*'
# jwt过期时间
JWT_EXPIRATION_DAYS
=
1
# JWT_EXPIRATION_DAYS = 1
JWT_EXPIRATION_DAYS
=
30
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment