Ar-jun-fs9/api-rate-limiter ? reverse-engineered prompt
Reverse engineered prompt
Build me a Django app that acts like an API rate limiter.
I want each API request to require an X API Key header, and if the key is missing or invalid, the app should return a clear 401 response. For valid keys, it should track requests in Redis with separate limits for different endpoints, so some routes can allow more requests than others. When someone goes over their limit, return a 429 response with a helpful JSON error.
Please also include response headers that show the current quota, like the total limit and how many requests are left. I’d like a simple homepage at / that explains how to use the API, plus a basic admin area to manage API keys. If it helps, use current docs online for Django, DRF, or Redis setup details.
Make it work locally with a simple run command, and keep it ready for deployment too.
Are you gonna build this?
make sure you review the code using coderabbit