https://github.com/redis-developer/basic-caching-demo-python
This project shows a basic caching demo in Python
https://github.com/redis-developer/basic-caching-demo-python
Last synced: 10 months ago
JSON representation
This project shows a basic caching demo in Python
- Host: GitHub
- URL: https://github.com/redis-developer/basic-caching-demo-python
- Owner: redis-developer
- Created: 2020-12-30T11:31:47.000Z (about 5 years ago)
- Default Branch: dev
- Last Pushed: 2023-06-27T07:19:24.000Z (over 2 years ago)
- Last Synced: 2025-05-08T21:44:19.702Z (10 months ago)
- Language: Python
- Size: 4.03 MB
- Stars: 3
- Watchers: 5
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Django(python) Redis caching Example
Show how the redis works with Django(Python).
# Overview video
Here's a short video that explains the project and how it uses Redis:
[](https://youtube.com/watch?v=x4dwTM97tBM)
# Redis rate-caching example front

# Redis rate-caching example (command line)

## Try it out
(See notes: How to run on Google Cloud)
## How to run on Google Cloud
After successful deployment, you need to manually enable the vpc connector as shown in the pictures:
1. Open link google cloud console.

2. Click "Edit and deploy new revision" button.

3. Select vpc-connector and deploy application.

Problem with unsupported the flags when deploying google cloud run button
---
## How to run it locally?
### Run docker compose or install redis manually
Install docker (on mac: https://docs.docker.com/docker-for-mac/install/)
```sh
docker network create global
docker-compose up -d --build
```
#### If you install redis manually open django-backend/configuration folder and copy `.env.example` to create `.env`. And provide the values for environment variables
- REDIS_HOST: Redis server host
- REDIS_PORT: Redis server port
- REDIS_DB: Redis server db index
- REDIS_PASSWORD: Redis server password
#### Setup and run backend
Install python, pip and venv (on mac: https://installpython3.com/mac/)
Use python version: 3.8
``` sh
python3 -m venv venv
source ./venv/bin/activate
pip3 install -r requirements.txt
python3 manage.py collectstatic
gunicorn configuration.asgi:application -b 127.0.0.1:5000 -k uvicorn.workers.UvicornWorker
```