{"id":21672564,"url":"https://github.com/redis-developer/basic-rate-limiting-demo-python","last_synced_at":"2026-02-28T11:08:57.353Z","repository":{"id":41316580,"uuid":"325534334","full_name":"redis-developer/basic-rate-limiting-demo-python","owner":"redis-developer","description":"This repo shows a basic rate limiting demo in Python and Django","archived":false,"fork":false,"pushed_at":"2023-06-27T07:21:41.000Z","size":7286,"stargazers_count":10,"open_issues_count":4,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-12T03:53:19.510Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redis-developer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-12-30T11:34:50.000Z","updated_at":"2024-12-05T14:46:55.000Z","dependencies_parsed_at":"2025-04-12T03:53:20.475Z","dependency_job_id":"82cba745-9926-4335-b6c1-55cea1459b6d","html_url":"https://github.com/redis-developer/basic-rate-limiting-demo-python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/redis-developer/basic-rate-limiting-demo-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redis-developer%2Fbasic-rate-limiting-demo-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redis-developer%2Fbasic-rate-limiting-demo-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redis-developer%2Fbasic-rate-limiting-demo-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redis-developer%2Fbasic-rate-limiting-demo-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redis-developer","download_url":"https://codeload.github.com/redis-developer/basic-rate-limiting-demo-python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redis-developer%2Fbasic-rate-limiting-demo-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29931449,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T09:58:13.507Z","status":"ssl_error","status_checked_at":"2026-02-28T09:57:57.047Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T13:30:06.784Z","updated_at":"2026-02-28T11:08:57.315Z","avatar_url":"https://github.com/redis-developer.png","language":"Python","readme":"\u003cdiv style=\"position: absolute; top: 0px; right: 0px;\"\u003e\n    \u003cimg width=\"200\" height=\"200\" src=\"https://redislabs.com/wp-content/uploads/2020/12/RedisLabs_Illustration_HomepageHero_v4.svg\"\u003e\n\u003c/div\u003e\n\u003cdiv style=\"height: 150px\"\u003e\u003c/div\u003e\n\n# Basic Redis Rate-limiting Demo Python (Django)\n\nShow how the redis works with Python (Django).\n\n\n## Try it out\n\n\u003cp\u003e\n    \u003ca href=\"https://heroku.com/deploy\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://www.herokucdn.com/deploy/button.svg\" alt=\"Deploy to Heorku\" width=\"200px\"/\u003e\n    \u003ca\u003e\n\u003c/p\u003e\n\n\u003cp\u003e\n    \u003ca href=\"https://vercel.com/new/git/external?repository-url=https://github.com/redis-developer/basic-rate-limiting-demo-python/tree/master\u0026env=REDIS_HOST,REDIS_PORT,REDIS_PASSWORD\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://vercel.com/button\" alt=\"Deploy with Vercel\" width=\"200px\" height=\"50px\"/\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp\u003e\n    \u003ca href=\"https://deploy.cloud.run/?dir=google-cloud-run\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://deploy.cloud.run/button.svg\" alt=\"Run on Google Cloud\" width=\"200px\"/\u003e\n    \u003c/a\u003e\n    \n\u003c/p\u003e\n\n## How to run on Google Cloud\n\n###  1. Click \"Run on Google Cloud\" \n        \nOpen up the link under \"Manage this application at Cloud Console\"\n\n![](https://raw.githubusercontent.com/redis-developer/basic-rate-limiting-demo-python/master/image1.jpg?v=2\u0026s=2)\n\n\n        \n### 2. Click “Edit and Deploy New Revision”\n        \n![](https://raw.githubusercontent.com/redis-developer/basic-rate-limiting-demo-python/master/image2.jpg?v=2\u0026s=2)\n\n\n### 3. Click “Variables and Secrets” \n\nSupply Redis Enterprise Cloud Endpoint URL\n        \n![](https://raw.githubusercontent.com/redis-developer/basic-rate-limiting-demo-python/master/image3.jpg?v=2\u0026s=2)\n        \n### 4. Enable HTTP/2\n        \nEnsure that you have Redis Enterprise Cloud DB created under GCP.\n        \n![](https://raw.githubusercontent.com/redis-developer/basic-rate-limiting-demo-python/master/image_4.jpg?v=2\u0026s=2)\n\n### 5. Allow all the traffic\n        \n![](https://raw.githubusercontent.com/redis-developer/basic-rate-limiting-demo-python/master/image_5.jpg?v=2\u0026s=2)\n        \n        \nHence, you should be able to access Rate Limiting app\n\n\n![](https://raw.githubusercontent.com/redis-developer/basic-rate-limiting-demo-python/master/image_6.pjpg?v=2\u0026s=2)\n\n---\n\n# How it works?\n\n## 1. How the data is stored:\n\u003col\u003e\n    \u003cli\u003eNew responses are added key-ip:\u003cpre\u003e SETNX your_ip:PING limit_amount\n Example: SETNX 127.0.0.1:PING 10 \u003c/pre\u003e\u003ca href=\"https://redis.io/commands/setnx\"\u003e\n more information\u003c/a\u003e \n \u003cbr\u003e \u003cbr\u003e\n \u003c/li\u003e\n \u003cli\u003e Set a timeout on key:\u003cpre\u003eEXPIRE your_ip:PING timeout\nExample: EXPIRE 127.0.0.1:PING 1000 \u003c/pre\u003e\u003ca href=\"https://redis.io/commands/expire\"\u003e\n more information\u003c/a\u003e\n \u003c/li\u003e\n\u003c/ol\u003e\n\u003cbr/\u003e\n\n## 2. How the data is accessed:\n\u003col\u003e\n    \u003cli\u003eNext responses are get bucket: \u003cpre\u003eGET your_ip:PING\nExample: GET 127.0.0.1:PING   \n\u003c/pre\u003e\u003ca href=\"https://redis.io/commands/get\"\u003e\nmore information\u003c/a\u003e\n\u003cbr\u003e \u003cbr\u003e\n\u003c/li\u003e\n    \u003cli\u003e Next responses are changed bucket: \u003cpre\u003eDECRBY your_ip:PING amount\nExample: DECRBY 127.0.0.1:PING 1\u003c/pre\u003e\n\u003ca href=\"https://redis.io/commands/decrby\"\u003e\nmore information\u003c/a\u003e  \u003c/li\u003e\n\u003c/ol\u003e\n \n---\n\n## How to run it locally?\n\n```\ngit clone https://github.com/redis-developer/basic-rate-limiting-demo-python.git\n```\n\n\n### Run docker compose or install redis manually\nInstall docker (on mac: https://docs.docker.com/docker-for-mac/install/)\n```sh\ndocker network create global\ndocker-compose up -d --build\n```\n\n\n#### Open directory server (cd server/configuration): copy .env.example to create .env (copy .env.example .env  or cp .env.example .env). And provide the values for environment variables (if needed)\n    - DJANGO_DEBUG: Django debug mode\n    - ALLOWED_HOSTS: Allowed hosts\n    - REDIS_URL: Redis server url\n    - REDIS_HOST: Redis server host\n    - REDIS_PORT: Redis server port\n    - REDIS_DB: Redis server db index\n    - REDIS_PASSWORD: Redis server password\n\n#### Run backend\n\nInstall python, pip and venv (on mac: https://installpython3.com/mac/)\n\nUse python version: 3.8\n``` sh\npython3 -m venv venv\nsource ./venv/bin/activate\npip3 install -r requirements.txt\npython3 server/manage.py collectstatic\npython3 server/manage.py runserver\n```\n\n#### Run frontend\n\nStatic сontent runs automatically with the backend part.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredis-developer%2Fbasic-rate-limiting-demo-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredis-developer%2Fbasic-rate-limiting-demo-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredis-developer%2Fbasic-rate-limiting-demo-python/lists"}