https://github.com/basemax/firstredispython
A tiny python web application based on Flask to set, get, expire, delete keys of Redis database easily with direct link at the browser.
https://github.com/basemax/firstredispython
flask flask-api flask-application flask-redis python python-redis python-redis-tutorial python3 redis
Last synced: 6 months ago
JSON representation
A tiny python web application based on Flask to set, get, expire, delete keys of Redis database easily with direct link at the browser.
- Host: GitHub
- URL: https://github.com/basemax/firstredispython
- Owner: BaseMax
- License: gpl-3.0
- Created: 2021-06-20T00:26:16.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-06-20T01:08:03.000Z (over 4 years ago)
- Last Synced: 2025-07-19T06:32:19.754Z (6 months ago)
- Topics: flask, flask-api, flask-application, flask-redis, python, python-redis, python-redis-tutorial, python3, redis
- Language: Python
- Homepage:
- Size: 23.4 KB
- Stars: 10
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# First Redis Python (CRUD)
A tiny **python** web application based on **Flask** to set, get, expire, delete keys of **Redis** database easily with direct link at the browser.
## Using
```
flask run
```
## Routes
**Set a new key with value:**
`http://127.0.0.1:5000/set/name/Max`
**Update the value of a key:**
`http://127.0.0.1:5000/update/name/NewMax`
**Get value of a key:**
`http://127.0.0.1:5000/get/name`
**Set value to a key with expire time:**
`http://127.0.0.1:5000/set/name/Max/5`
**Set expire time on a key:**
`http://127.0.0.1:5000/expire/name/10`
**Delete a key:**
`http://127.0.0.1:5000/delete/name`
**Note:** You do not have to put `/` at the last of the URL, this is not allowed.
### References
- https://redis.io/commands/expire
- https://stackoverflow.com/questions/36000981/storing-keys-with-prefix-that-expire-in-redis
- https://redis-py.readthedocs.io/en/stable/
- https://realpython.com/python-redis/
- https://stackoverflow.com/questions/36000981/storing-keys-with-prefix-that-expire-in-redis
- https://redis-py.readthedocs.io/en/stable/_modules/redis/client.html#Redis.expire
- https://medium.com/@ashok.tankala/how-to-write-your-own-redis-key-expire-listener-in-python-53e531a97f36
© Copyright Max Base, 2021