Skip to content

Commit

Permalink
added itsdangerous terminal commands
Browse files Browse the repository at this point in the history
  • Loading branch information
hey-granth committed Dec 21, 2024
1 parent c1ae001 commit 690eafc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions personal-references/itsdangerous-terminal-cmds.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# itsdangerous Terminal Commands

- python3
- from itsdangerous import URLSafeTimedSerializer as Serializer
- s = Serializer('secret')
- token = s.dumps({'user_id':1})
- token = s.loads(token, 30)
> It is used to create a serializer object `s` with a `secret key` and a time limit of 30 seconds. And `token` is used to dump and load the data.

0 comments on commit 690eafc

Please sign in to comment.