You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See [docs](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template) or just use git clone.
65
65
66
-
### 2. Install dependecies with [uv](https://docs.astral.sh/uv/getting-started/installation/)
66
+
### 2. Install dependencies with [uv](https://docs.astral.sh/uv/getting-started/installation/)
67
67
68
68
```bash
69
69
cd your_project_name
@@ -407,13 +407,13 @@ Rethink `delete_current_user`, maybe you don't need it.
407
407
408
408
By using `/auth/access-token` user can exchange username + password for JWT. Refresh tokens is saved **in database table**. I've seen a lot of other, not always secure or sane setups. It's up to you if you want to change it to be also JWT (which seems to be popular), just one small note: It's `good` design if one can revoke all or preferably some refresh tokens. It's much `worse` design if one cannot. On the other hand, it's fine not to have option to revoke access tokens (as they are shortlived).
409
409
410
-
### Writting scripts / cron
410
+
### Writing scripts / cron
411
411
412
412
Very rarely app has not some kind of background tasks. Feel free to use `new_script_async_session` if you need to have access to database outside of FastAPI. Cron can be simply: new file, async task with session (doing something), wrapped by `asyncio.run(script_func())`.
413
413
414
414
### Docs URL
415
415
416
-
Docs page is simpy`/` (by default in FastAPI it is `/docs`). You can change it completely for the project, just as title, version, etc.
416
+
Docs page is simply`/` (by default in FastAPI it is `/docs`). You can change it completely for the project, just as title, version, etc.
417
417
418
418
```python
419
419
app = FastAPI(
@@ -427,7 +427,7 @@ app = FastAPI(
427
427
428
428
### CORS
429
429
430
-
If you are not sure what are CORS for, follow [developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS). Most frontend frameworks nowadays operate on `http://localhost:3000` thats why it's included in `BACKEND_CORS_ORIGINS` in `.env` file, before going production be sure to include your frontend domain there, like `https://my-fontend-app.example.com`.
430
+
If you are not sure what are CORS for, follow [developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS). Most frontend frameworks nowadays operate on `http://localhost:3000` thats why it's included in `BACKEND_CORS_ORIGINS` in `.env` file, before going production be sure to include your frontend domain there, like `https://my-frontend-app.example.com`.
431
431
432
432
```python
433
433
app.add_middleware(
@@ -441,7 +441,7 @@ app.add_middleware(
441
441
442
442
### Allowed Hosts
443
443
444
-
This middleware prevents HTTP Host Headers attack, you shoud put here you server IP or (preferably) full domain under it's accessible like `example.com`. By default `"localhost", "127.0.0.1", "0.0.0.0"`
444
+
This middleware prevents HTTP Host Headers attack, you should put here your server IP or (preferably) full domain under which it's accessible like `example.com`. By default `"localhost", "127.0.0.1", "0.0.0.0"`
0 commit comments