Skip to content

Commit 055c1ca

Browse files
committed
fix warning include more gitignore
1 parent 7097959 commit 055c1ca

File tree

4 files changed

+40
-3
lines changed

4 files changed

+40
-3
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ PROJECT_NAME="FastAPI Project"
1717
STACK_NAME=full-stack-fastapi-project
1818

1919
# Backend
20-
BACKEND_CORS_ORIGINS="http://localhost,http://localhost:5173,https://localhost,https://localhost:5173,http://localhost.tiangolo.com"
20+
BACKEND_CORS_ORIGINS="http://localhost,http://localhost:5173,https://localhost,https://localhost:5173"
2121
SECRET_KEY=changethis-generate-a-secure-random-secret-key
2222
FIRST_SUPERUSER=admin@example.com
2323
FIRST_SUPERUSER_PASSWORD=changethis

backend/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ __pycache__
22
app.egg-info
33
*.pyc
44
.mypy_cache
5+
.pytest_cache
6+
.ruff_cache
57
.coverage
68
htmlcov
79
.cache

backend/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,42 @@ As during local development your app directory is mounted as a volume inside the
127127

128128
Make sure you create a "revision" of your models and that you "upgrade" your database with that revision every time you change them. As this is what will update the tables in your database. Otherwise, your application will have errors.
129129

130+
### Running Migrations Locally (without Docker)
131+
132+
From the `./backend/` directory, you can run Alembic commands using `uv run`:
133+
134+
* Apply all pending migrations:
135+
136+
```console
137+
$ uv run alembic upgrade head
138+
```
139+
140+
* Create a new migration after changing models:
141+
142+
```console
143+
$ uv run alembic revision --autogenerate -m "Add column last_name to User model"
144+
```
145+
146+
* View migration history:
147+
148+
```console
149+
$ uv run alembic history
150+
```
151+
152+
* Check current database revision:
153+
154+
```console
155+
$ uv run alembic current
156+
```
157+
158+
* Rollback the last migration:
159+
160+
```console
161+
$ uv run alembic downgrade -1
162+
```
163+
164+
### Running Migrations with Docker
165+
130166
* Start an interactive session in the backend container:
131167

132168
```console

backend/app/core/csrf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
- GET, HEAD, OPTIONS requests (safe methods)
1616
"""
1717

18-
from collections.abc import Callable
19-
from typing import Awaitable
18+
from collections.abc import Awaitable, Callable
2019

2120
from fastapi import Request, Response
2221
from starlette.middleware.base import BaseHTTPMiddleware

0 commit comments

Comments
 (0)