Add Python Workers FastAPI, Django, Flask starter kits - #15636
Add Python Workers FastAPI, Django, Flask starter kits#15636ryanking13 wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: 334e392 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Codeowners approval required for this PR:
Show detailed file reviewers
|
@cloudflare/autoconfig
@cloudflare/build-output-utils
@cloudflare/codemods
@cloudflare/config
@cloudflare/containers-shared
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-functions
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-plugin
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
| django: djangoTemplate, | ||
| docusaurus: docusaurusTemplate, | ||
| fastapi: fastapiTemplate, | ||
| flask: flaskTemplate, |
There was a problem hiding this comment.
🟡 Experimental Python starters always fail
With --experimental, each new framework reaches create without generated files. The experimental path skips copyTemplateFiles, so project setup fails on the missing package.
Learn more
Experimental C3 normally runs a framework generator, skips static template copying, and delegates configuration to wrangler setup. These three configs define only copyFiles, so selecting one in experimental mode creates no directory before package-name processing runs.
Example: create-cloudflare app --experimental --framework django --lang python selects Django from this map. create skips copyTemplateFiles, then updatePackageName tries to read app/package.json instead of producing a Django project.
Recommended fix: Either omit these static frameworks from getFrameworkMap({ experimental: true }), or make the experimental creation path copy static templates before running autoconfiguration.
Was this helpful? React with 👍 or 👎 to provide feedback.
| django: djangoTemplate, | ||
| docusaurus: docusaurusTemplate, | ||
| fastapi: fastapiTemplate, | ||
| flask: flaskTemplate, |
There was a problem hiding this comment.
🟡 Defaults reject Python framework selection
With --accept-defaults, --framework django inherits lang=ts. Language filtering removes every new Python framework, so non-interactive creation reports it unsupported.
Learn more
The --accept-defaults option populates unspecified arguments from C3_DEFAULTS, whose language is ts. createContext filters the framework map by that language before resolving the explicitly requested framework. Since each new config exposes only a python variant, all three disappear from the map.
Example: create-cloudflare app --framework django --accept-defaults --no-deploy fails with Unsupported framework: django. The same command with --lang python succeeds.
Recommended fix: Derive lang="python" when one of these Python-only frameworks is explicitly selected and no language was explicitly supplied. Preserve rejection for an explicitly incompatible --lang value.
Was this helpful? React with 👍 or 👎 to provide feedback.
| @@ -0,0 +1,9 @@ | |||
| SECRET_KEY = "" | |||
| DEBUG = False | |||
| ALLOWED_HOSTS = [] | |||
dom96
left a comment
There was a problem hiding this comment.
Nice! Looks good from my side.
| @@ -0,0 +1,13 @@ | |||
| { | |||
| "name": "<PACKAGE_NAME>", | |||
| "version": "0.0.0", | |||
There was a problem hiding this comment.
Nit for consistency:
| "version": "0.0.0", | |
| "version": "0.1.0", |
Add Python web frameworks starter kits for Django, FastAPI, Flask. Python workers team recently added support for these frameworks, so it would be good to have these templates.
Screen.Recording.2026-09-14.at.8.38.00.PM.mov