Back to templates

Template details

Django REST Framework + Vercel

A minimal Django REST Framework API running on Vercel Serverless Functions.

About this template

Django REST Framework + Vercel is a minimal starter boilerplate from Vercel that deploys a Django REST Framework API as a Vercel Serverless Function using the Python Runtime.

What is Django REST Framework + Vercel?

This template is a minimal Django REST Framework API that runs on Vercel Serverless Functions using the Python Runtime. It is part of Vercel's official examples repository. The template exposes a single read-only endpoint at /api/time/ that returns the current UTC time as JSON. It takes a GET request and returns a JSON response with an ISO 8601 timestamp.

Key Features

  • Single REST endpoint — A DRF view in api/views.py returns the current UTC time in ISO 8601 format via a GET request to /api/time/.
  • Vercel Serverless Functions — The app is served through the Python Runtime as a serverless function, with no need for a separate Django production server.
  • WSGI integration — config/wsgi.py exposes get_wsgi_application() to connect Django to Vercel.
  • Environment variable handling — Requires DJANGO_SECRET_KEY; you can generate one with uv and add it to Vercel via the CLI.
  • One-click deploy — A deploy button on the README clones the repository and prompts for the secret key.
  • Local development — Run uv sync then uv run python manage.py runserver to test at localhost:8000.
  • Official Vercel example — Maintained by Vercel in the vercel/examples repository with over 5,100 stars.

Who should use Django REST Framework + Vercel?

  • Django developers who want to deploy a REST API on Vercel's serverless platform without provisioning a server.
  • Full-stack engineers building small JSON APIs that need fast deployment via Vercel.
  • Prototypers who need a minimal Django REST Framework setup for experiments or internal tools that can scale to serverless.

What can you do with Django REST Framework + Vercel?

  • Expose a public time API: Deploy the template as-is and get a working /api/time/ endpoint that returns coordinated universal time in JSON.
  • Build a custom REST API: Replace the sample view with your own serializers and viewsets while relying on Vercel for hosting.
  • Learn Django REST Framework + serverless: Use the minimal codebase to understand how DRF views and Vercel's Python Runtime fit together.

How does Django REST Framework + Vercel work?

The template includes a single Django REST Framework view decorated with api_view(['GET']). That view returns a DRF Response containing the current UTC time. The Django application is exposed through WSGI, and Vercel maps the /api/time/ route to the serverless function. You must set DJANGO_SECRET_KEY as an environment variable before the app can run.

FAQ

Is Django REST Framework + Vercel free to use?

The template itself is free and open source. Deploying to Vercel requires a Vercel account; Vercel offers a free tier for hobby projects, though this page does not list specific pricing.

What dependencies does the template use?

It uses Django, Django REST Framework, and the Python runtime on Vercel. Package management is done with uv, as shown by the uv sync command in the README.

How do I set the DJANGO_SECRET_KEY?

Run the given command with uv to generate a random key, then pipe it into vercel env add -y DJANGO_SECRET_KEY prod to store it for production. You can also set it through the Vercel dashboard.

Does the template support database integration?

No database is included or configured. The demo only returns the current time from the server, and the README does not mention any database setup.

Can I use this template for a production API?

It is a minimal starter, so you would need to add your own models, authentication, and any other production concerns. The included view is a single GET endpoint with no database.

screenshot of Django REST Framework + Vercel on template0.com