fastapi-cors
Simple env support of CORS settings for Fastapi applications
Decision gist · record as of 2026-08-14
No. The package is abandoned and receives no maintenance. For new projects, use FastAPI's built-in CORSMiddleware directly with environment variable parsing via environs or python-dotenv—you gain the same functionality with active upstream support. For existing projects already using fastapi-cors, migration is straightforward since the underlying FastAPI CORS API is stable.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires fastapi and environs as runtime dependencies; reads .env file during import.
- Low install friction with only two runtime dependencies (environs and fastapi).
- However, the package is abandoned—last release was 2023-07-12 with no updates since, so expect no maintenance or security patches going forward.
License · maintenance · safety
MIT (permissive) — MIT license is permissive, allowing commercial and private use with minimal restrictions.
last release 2023-07-12 (1129 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 240,558 downloads/mo, #8,904 on PyPI
Alternatives
Verify before relying
pip install fastapi-cors
from fastapi import FastAPI
from fastapi_cors import CORS
app = FastAPI()
CORS(app)- Whether the package's defaults (localhost:3000 origins, all methods, credentials enabled) are suitable for production use cases beyond development.
- How the health-check endpoint behaves when CORS restrictions are in place and whether it poses any security concerns.
What it is and what it does
fastapi-cors is a thin wrapper around FastAPI's built-in CORS middleware that reads configuration from environment variables instead of requiring programmatic setup. It lets you define allowed origins, methods, headers, and credential support through a .env file, then applies those settings with a single function call. The package includes an optional health-check route that displays the active CORS environment variables.
The package is designed for developers who want to manage CORS policy through environment configuration rather than code. It depends on environs to parse and cast environment variables, and fastapi as its target framework. Since the package is abandoned (no updates since July 2023), it receives no maintenance or security updates, making it suitable only for stable, low-risk deployments or as a reference implementation rather than a production dependency.
Use it for
- Configure CORS for a FastAPI app using only environment variables, avoiding hardcoded origin lists in code.
- Set different CORS policies across development, staging, and production by changing .env files without code changes.
- Add a health-check endpoint that reports the active CORS configuration for debugging cross-origin request issues.
- Quickly scaffold a FastAPI app with sensible CORS defaults (localhost and localhost:3000 allowed) for local development.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
No.
The package is abandoned and receives no maintenance. For new projects, use FastAPI's built-in CORSMiddleware directly with environment variable parsing via environs or python-dotenv—you gain the same functionality with active upstream support. For existing projects already using fastapi-cors, migration is straightforward since the underlying FastAPI CORS API is stable.
Install
fastapi-cors on PyPI
Before you install
Low install friction with only two runtime dependencies (environs and fastapi). However, the package is abandoned—last release was 2023-07-12 with no updates since, so expect no maintenance or security patches going forward.
Requires fastapi and environs as runtime dependencies; reads .env file during import.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions.
Quickstart
pip install fastapi-cors
from fastapi import FastAPI
from fastapi_cors import CORS
app = FastAPI()
CORS(app)
Verify before relying
- Whether the package's defaults (localhost:3000 origins, all methods, credentials enabled) are suitable for production use cases beyond development.
- How the health-check endpoint behaves when CORS restrictions are in place and whether it poses any security concerns.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesenvironsfastapi |
| Maintenance | Abandoned 1,129 days since the last release |
| First released | |
| Downloads | 240,558 / month, #8,904 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Environment :: Web EnvironmentFramework :: FastAPIIntended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: System AdministratorsLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: InternetTopic :: Internet :: WWW/HTTPTopic :: Internet :: WWW/HTTP :: HTTP ServersTopic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Application FrameworksTopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed |
Evidence: fastapi_cors-0.0.6-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “fastapi cors environment variables”
- fastapi-corsConfigures CORS settings for FastAPI applications via environment…
- fastapi-cloud-cliA command-line tool for deploying and managing FastAPI applications…
- prometheus-fastapi-instrumentatorAdds Prometheus metrics collection and exposure to FastAPI…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also aiohttp-cors · flask-cors · django-cors-headers · Sanic-Cors · cherrypy-cors · quart-cors · invenio-rest · python-json-config · envier · environs