<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/my-own-python-web-framework-zlcxurcbz" -->

---
title: My Own Python Web Framework | daily.dev
description: A developer built Jar, a toy Python web framework implemented in about 200 lines of code, to explore framework API design and deploy to Vercel via its Build...
canonical: https://daily.dev/posts/my-own-python-web-framework-zlcxurcbz
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: My Own Python Web Framework | daily.dev
og:description: A developer built Jar, a toy Python web framework implemented in about 200 lines of code, to explore framework API design and deploy to Vercel via its Build...
og:url: https://daily.dev/posts/my-own-python-web-framework-zlcxurcbz
og:image: https://api.daily.dev/og/posts/ZLcXurcBZ.png
og:image:alt: My Own Python Web Framework
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# My Own Python Web Framework

**[Andrew Healey's Blog](https://daily.dev/sources/healeycodes)** · 7 min read · 0 upvotes · 0 comments

## Summary

A developer built Jar, a toy Python web framework implemented in about 200 lines of code, to explore framework API design and deploy to Vercel via its Build Output API. It uses file-system routing with three page types: build (static files), fresh (serverless functions), and regenerated (prerender functions), a little inspired by Next.js's getServerSideProps and getStaticProps. Pages are imported dynamically at run time, and the build-time functions are read from memory via Python's inspect module and written to a handler file for Vercel's python3.9 runtime. A bug where tests sometimes failed in CI was traced to how json.dumps orders keys, and took thirty minutes to find and fix. The author says not to actually use it.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://healeycodes.com/my-own-python-web-framework>

## Questions this post answers

### How can I deploy a custom Python web framework to Vercel without using Next.js?

You can use Vercel's Build Output API, a file-system-based specification that lets any framework build for Vercel and use its infrastructure primitives like Edge Functions, Edge Middleware, ISR, and Image Optimization. A project named Jar demonstrates this in about 200 lines of code, generating static files, serverless functions, and prerender functions under a .vercel/output directory.

_daily.dev surfaces deep dives like this for developers piecing together custom deployment pipelines on Vercel._

### How do Vercel Serverless Functions know which files to include from the project directory?

A Serverless Function is represented as a directory with a .func suffix inside .vercel/output/functions; only files below that directory are included, and a .vc-config.json file inside it specifies the handler and runtime (for example, python3.9). Third-party packages must be installed locally at the project root, such as with pip install --target ., so they get bundled into the function correctly.

_developers wiring custom build pipelines on Vercel can keep these packaging details on hand via daily.dev._

### Why would json.dumps cause flaky tests in CI for a build process?

Python's json.dumps does not guarantee consistent key ordering by default, so a build config serialized without sort_keys=True can produce different output across runs, breaking snapshot tests in CI. Adding sort_keys=True to json.dump(build_config, f, sort_keys=True) fixed a flaky test suite in one Python web framework's build pipeline, a bug that took thirty minutes to track down.

_track down subtle Python serialization bugs like this faster by following practical debugging write-ups on daily.dev._

## Similar posts on daily.dev

- [Python projects now support routing rules](https://daily.dev/posts/python-projects-now-support-routing-rules-3njqyplqs) · Vercel · 2 upvotes · 0 comments
- [PyView: Real-time Python Web Apps](https://daily.dev/posts/pyview-real-time-python-web-apps-2huh9on7d) · Planet Python · 0 upvotes · 0 comments
- [Start Building With FastAPI – Real Python](https://daily.dev/posts/start-building-with-fastapi-real-python-8xvvqkf33) · Real Python · 0 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python), [#serverless](https://daily.dev/tags/serverless), [#vercel](https://daily.dev/tags/vercel)

[View this post on daily.dev](https://daily.dev/posts/my-own-python-web-framework-zlcxurcbz)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"My Own Python Web Framework","url":"https://daily.dev/posts/my-own-python-web-framework-zlcxurcbz","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/my-own-python-web-framework-zlcxurcbz"},"datePublished":"2026-11-15T08:55:45.798Z","dateModified":"2026-11-15T09:22:51.839Z","description":"A developer built Jar, a toy Python web framework implemented in about 200 lines of code, to explore framework API design and deploy to Vercel via its Build...","image":"https://media.daily.dev/image/upload/s--OHB84bZF--/f_auto/v1722860399/public/Placeholder%2010","thumbnailUrl":"https://media.daily.dev/image/upload/s--OHB84bZF--/f_auto/v1722860399/public/Placeholder%2010","isAccessibleForFree":true,"articleSection":"Andrew Healey's Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Andrew Healey's Blog","logo":"https://media.daily.dev/image/upload/s--sQ4y8SuR--/f_auto,q_auto/v1794732940/logos/healeycodes?_a=BAMAMiiw0","url":"https://daily.dev/sources/healeycodes"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/my-own-python-web-framework-zlcxurcbz","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python,serverless,vercel","timeRequired":"PT7M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Andrew Healey's Blog","item":"https://daily.dev/sources/healeycodes"},{"@type":"ListItem","position":3,"name":"My Own Python Web Framework"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/my-own-python-web-framework-zlcxurcbz#faq","mainEntity":[{"@type":"Question","name":"How can I deploy a custom Python web framework to Vercel without using Next.js?","acceptedAnswer":{"@type":"Answer","text":"You can use Vercel's Build Output API, a file-system-based specification that lets any framework build for Vercel and use its infrastructure primitives like Edge Functions, Edge Middleware, ISR, and Image Optimization. A project named Jar demonstrates this in about 200 lines of code, generating static files, serverless functions, and prerender functions under a .vercel/output directory. daily.dev surfaces deep dives like this for developers piecing together custom deployment pipelines on Vercel."}},{"@type":"Question","name":"How do Vercel Serverless Functions know which files to include from the project directory?","acceptedAnswer":{"@type":"Answer","text":"A Serverless Function is represented as a directory with a .func suffix inside .vercel/output/functions; only files below that directory are included, and a .vc-config.json file inside it specifies the handler and runtime (for example, python3.9). Third-party packages must be installed locally at the project root, such as with pip install --target ., so they get bundled into the function correctly. developers wiring custom build pipelines on Vercel can keep these packaging details on hand via daily.dev."}},{"@type":"Question","name":"Why would json.dumps cause flaky tests in CI for a build process?","acceptedAnswer":{"@type":"Answer","text":"Python's json.dumps does not guarantee consistent key ordering by default, so a build config serialized without sort_keys=True can produce different output across runs, breaking snapshot tests in CI. Adding sort_keys=True to json.dump(build_config, f, sort_keys=True) fixed a flaky test suite in one Python web framework's build pipeline, a bug that took thirty minutes to track down. track down subtle Python serialization bugs like this faster by following practical debugging write-ups on daily.dev."}}]}
```

