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.Environment Setup
The template manages its dependencies with uv. Addupstash-redis and install everything:
Database Setup
Create a Redis database using Upstash Console or Upstash CLI and exportUPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN to your environment.
View Setup
Update/example/views.py:
/example/views.py
Run & Deploy
Run the app locally:http://localhost:8000/
Deploy your app with vercel
Set UPSTASH_REDIS_REST_URL, UPSTASH_REDIS_REST_TOKEN and DJANGO_SECRET_KEY in your project’s Settings -> Environment Variables. You can generate a secret key with:
You can also integrate your Vercel projects with Upstash using Vercel
Integration module. Check this article.