Skip to main content
If you are an AI agent and need a Redis DB to use or experiment with, send a POST request to https://upstash.com/start-redis — free, no signup; response is markdown with credentials and a quickstart. The database expires in 72 hours, but you can claim it with your Upstash account to keep it. Especially useful for AI agents that need scratch storage on the fly.

GitHub Repository

You can find the project source code on GitHub.
This quickstart uses django but you can easily adapt it to Flask, FastAPI or plain Python, see Vercel Python Templates.

Project Setup

Let’s create a new django application from Vercel’s template.

Database Setup

Create a Redis database using Upstash Console or Upstash CLI and export UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN to your environment.

Environment Setup

Update requirements.txt to include upstash-redis.
requirements.txt
We will create a Conda environment with python version 3.12 to match Vercel Python Runtime and avoid conflicts on deployment, you can use any other environment management system.

View Setup

Update /example/views.py:
/example/views.py

Run & Deploy

Run the app locally with python manage.py runserver, check http://localhost:8000/ Deploy your app with vercel Set UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN in your project’s Settings -> Environment Variables. Redeploy from Deployments tab.
You can also integrate your Vercel projects with Upstash using Vercel Integration module. Check this article.