146 changed files with 1480 additions and 688 deletions
@ -1,13 +1,13 @@ |
|||||
Coming soon... |
Coming soon... |
||||
|
|
||||
```Python |
```Python |
||||
{!./tutorial/src/bigger-applications/tutorial001.py!} |
{!./tutorial/src/bigger_applications/app/routers/tutorial001.py!} |
||||
``` |
``` |
||||
|
|
||||
```Python |
```Python |
||||
{!./tutorial/src/bigger-applications/tutorial002.py!} |
{!./tutorial/src/bigger_applications/app/routers/tutorial002.py!} |
||||
``` |
``` |
||||
|
|
||||
```Python |
```Python |
||||
{!./tutorial/src/bigger-applications/tutorial003.py!} |
{!./tutorial/src/bigger_applications/app/tutorial003.py!} |
||||
``` |
``` |
||||
|
@ -1,7 +1,7 @@ |
|||||
from fastapi import FastAPI |
from fastapi import FastAPI |
||||
|
|
||||
from .tutorial01 import router as users_router |
from .routers.tutorial001 import router as users_router |
||||
from .tutorial02 import router as items_router |
from .routers.tutorial002 import router as items_router |
||||
|
|
||||
app = FastAPI() |
app = FastAPI() |
||||
|
|
@ -1,6 +1,7 @@ |
|||||
from fastapi import FastAPI |
|
||||
from pydantic import BaseModel |
from pydantic import BaseModel |
||||
|
|
||||
|
from fastapi import FastAPI |
||||
|
|
||||
app = FastAPI() |
app = FastAPI() |
||||
|
|
||||
|
|
@ -1,6 +1,7 @@ |
|||||
from fastapi import Body, FastAPI |
|
||||
from pydantic import BaseModel |
from pydantic import BaseModel |
||||
|
|
||||
|
from fastapi import Body, FastAPI |
||||
|
|
||||
app = FastAPI() |
app = FastAPI() |
||||
|
|
||||
|
|
@ -1,6 +1,7 @@ |
|||||
from fastapi import Body, FastAPI |
|
||||
from pydantic import BaseModel |
from pydantic import BaseModel |
||||
|
|
||||
|
from fastapi import Body, FastAPI |
||||
|
|
||||
app = FastAPI() |
app = FastAPI() |
||||
|
|
||||
|
|
@ -1,6 +1,7 @@ |
|||||
from fastapi import Body, FastAPI |
|
||||
from pydantic import BaseModel |
from pydantic import BaseModel |
||||
|
|
||||
|
from fastapi import Body, FastAPI |
||||
|
|
||||
app = FastAPI() |
app = FastAPI() |
||||
|
|
||||
|
|
@ -1,6 +1,7 @@ |
|||||
from fastapi import FastAPI |
|
||||
from pydantic import BaseModel |
from pydantic import BaseModel |
||||
|
|
||||
|
from fastapi import FastAPI |
||||
|
|
||||
app = FastAPI() |
app = FastAPI() |
||||
|
|
||||
|
|
@ -1,8 +1,9 @@ |
|||||
from typing import List |
from typing import List |
||||
|
|
||||
from fastapi import FastAPI |
|
||||
from pydantic import BaseModel |
from pydantic import BaseModel |
||||
|
|
||||
|
from fastapi import FastAPI |
||||
|
|
||||
app = FastAPI() |
app = FastAPI() |
||||
|
|
||||
|
|
@ -1,8 +1,9 @@ |
|||||
from typing import Set |
from typing import Set |
||||
|
|
||||
from fastapi import FastAPI |
|
||||
from pydantic import BaseModel |
from pydantic import BaseModel |
||||
|
|
||||
|
from fastapi import FastAPI |
||||
|
|
||||
app = FastAPI() |
app = FastAPI() |
||||
|
|
||||
|
|
@ -1,8 +1,9 @@ |
|||||
from typing import Set |
from typing import Set |
||||
|
|
||||
from fastapi import FastAPI |
|
||||
from pydantic import BaseModel |
from pydantic import BaseModel |
||||
|
|
||||
|
from fastapi import FastAPI |
||||
|
|
||||
app = FastAPI() |
app = FastAPI() |
||||
|
|
||||
|
|
@ -1,9 +1,10 @@ |
|||||
from typing import Set |
from typing import Set |
||||
|
|
||||
from fastapi import FastAPI |
|
||||
from pydantic import BaseModel |
from pydantic import BaseModel |
||||
from pydantic.types import UrlStr |
from pydantic.types import UrlStr |
||||
|
|
||||
|
from fastapi import FastAPI |
||||
|
|
||||
app = FastAPI() |
app = FastAPI() |
||||
|
|
||||
|
|
@ -1,9 +1,10 @@ |
|||||
from typing import List, Set |
from typing import List, Set |
||||
|
|
||||
from fastapi import FastAPI |
|
||||
from pydantic import BaseModel |
from pydantic import BaseModel |
||||
from pydantic.types import UrlStr |
from pydantic.types import UrlStr |
||||
|
|
||||
|
from fastapi import FastAPI |
||||
|
|
||||
app = FastAPI() |
app = FastAPI() |
||||
|
|
||||
|
|
@ -1,9 +1,10 @@ |
|||||
from typing import List, Set |
from typing import List, Set |
||||
|
|
||||
from fastapi import FastAPI |
|
||||
from pydantic import BaseModel |
from pydantic import BaseModel |
||||
from pydantic.types import UrlStr |
from pydantic.types import UrlStr |
||||
|
|
||||
|
from fastapi import FastAPI |
||||
|
|
||||
app = FastAPI() |
app = FastAPI() |
||||
|
|
||||
|
|
@ -1,9 +1,10 @@ |
|||||
from typing import List |
from typing import List |
||||
|
|
||||
from fastapi import FastAPI |
|
||||
from pydantic import BaseModel |
from pydantic import BaseModel |
||||
from pydantic.types import UrlStr |
from pydantic.types import UrlStr |
||||
|
|
||||
|
from fastapi import FastAPI |
||||
|
|
||||
app = FastAPI() |
app = FastAPI() |
||||
|
|
||||
|
|
@ -1,6 +1,7 @@ |
|||||
from fastapi import Body, FastAPI |
|
||||
from pydantic import BaseModel, Schema |
from pydantic import BaseModel, Schema |
||||
|
|
||||
|
from fastapi import Body, FastAPI |
||||
|
|
||||
app = FastAPI() |
app = FastAPI() |
||||
|
|
||||
|
|
@ -1,6 +1,7 @@ |
|||||
from fastapi import Body, FastAPI |
|
||||
from pydantic import BaseModel |
from pydantic import BaseModel |
||||
|
|
||||
|
from fastapi import Body, FastAPI |
||||
|
|
||||
app = FastAPI() |
app = FastAPI() |
||||
|
|
||||
|
|
@ -1,6 +1,7 @@ |
|||||
from fastapi import FastAPI |
|
||||
from starlette.responses import UJSONResponse |
from starlette.responses import UJSONResponse |
||||
|
|
||||
|
from fastapi import FastAPI |
||||
|
|
||||
app = FastAPI() |
app = FastAPI() |
||||
|
|
||||
|
|
@ -1,6 +1,7 @@ |
|||||
from fastapi import FastAPI |
|
||||
from starlette.responses import HTMLResponse |
from starlette.responses import HTMLResponse |
||||
|
|
||||
|
from fastapi import FastAPI |
||||
|
|
||||
app = FastAPI() |
app = FastAPI() |
||||
|
|
||||
|
|
@ -1,6 +1,7 @@ |
|||||
from fastapi import FastAPI |
|
||||
from starlette.responses import HTMLResponse |
from starlette.responses import HTMLResponse |
||||
|
|
||||
|
from fastapi import FastAPI |
||||
|
|
||||
app = FastAPI() |
app = FastAPI() |
||||
|
|
||||
|
|
@ -1,6 +1,7 @@ |
|||||
from fastapi import FastAPI |
|
||||
from starlette.responses import HTMLResponse |
from starlette.responses import HTMLResponse |
||||
|
|
||||
|
from fastapi import FastAPI |
||||
|
|
||||
app = FastAPI() |
app = FastAPI() |
||||
|
|
||||
|
|
@ -1,7 +1,8 @@ |
|||||
from fastapi import FastAPI |
|
||||
from pydantic import BaseModel |
from pydantic import BaseModel |
||||
from pydantic.types import EmailStr |
from pydantic.types import EmailStr |
||||
|
|
||||
|
from fastapi import FastAPI |
||||
|
|
||||
app = FastAPI() |
app = FastAPI() |
||||
|
|
||||
|
|
@ -1,7 +1,8 @@ |
|||||
from fastapi import FastAPI |
|
||||
from pydantic import BaseModel |
from pydantic import BaseModel |
||||
from pydantic.types import EmailStr |
from pydantic.types import EmailStr |
||||
|
|
||||
|
from fastapi import FastAPI |
||||
|
|
||||
app = FastAPI() |
app = FastAPI() |
||||
|
|
||||
|
|
@ -1,17 +1,19 @@ |
|||||
from typing import Optional |
from typing import Optional |
||||
|
|
||||
from fastapi import FastAPI |
|
||||
from pydantic import BaseModel |
from pydantic import BaseModel |
||||
|
|
||||
from couchbase import LOCKMODE_WAIT |
from couchbase import LOCKMODE_WAIT |
||||
from couchbase.bucket import Bucket |
from couchbase.bucket import Bucket |
||||
from couchbase.cluster import Cluster, PasswordAuthenticator |
from couchbase.cluster import Cluster, PasswordAuthenticator |
||||
|
from fastapi import FastAPI |
||||
|
|
||||
USERPROFILE_DOC_TYPE = "userprofile" |
USERPROFILE_DOC_TYPE = "userprofile" |
||||
|
|
||||
|
|
||||
def get_bucket(): |
def get_bucket(): |
||||
cluster = Cluster("couchbase://couchbasehost:8091?fetch_mutation_tokens=1&operation_timeout=30&n1ql_timeout=300") |
cluster = Cluster( |
||||
|
"couchbase://couchbasehost:8091?fetch_mutation_tokens=1&operation_timeout=30&n1ql_timeout=300" |
||||
|
) |
||||
authenticator = PasswordAuthenticator("username", "password") |
authenticator = PasswordAuthenticator("username", "password") |
||||
cluster.authenticate(authenticator) |
cluster.authenticate(authenticator) |
||||
bucket: Bucket = cluster.open_bucket("bucket_name", lockmode=LOCKMODE_WAIT) |
bucket: Bucket = cluster.open_bucket("bucket_name", lockmode=LOCKMODE_WAIT) |
@ -1,9 +1,10 @@ |
|||||
from typing import Set |
from typing import Set |
||||
|
|
||||
from fastapi import FastAPI |
|
||||
from pydantic import BaseModel |
from pydantic import BaseModel |
||||
from starlette.status import HTTP_201_CREATED |
from starlette.status import HTTP_201_CREATED |
||||
|
|
||||
|
from fastapi import FastAPI |
||||
|
|
||||
app = FastAPI() |
app = FastAPI() |
||||
|
|
||||
|
|
@ -1,8 +1,9 @@ |
|||||
from typing import Set |
from typing import Set |
||||
|
|
||||
from fastapi import FastAPI |
|
||||
from pydantic import BaseModel |
from pydantic import BaseModel |
||||
|
|
||||
|
from fastapi import FastAPI |
||||
|
|
||||
app = FastAPI() |
app = FastAPI() |
||||
|
|
||||
|
|
@ -1,8 +1,9 @@ |
|||||
from typing import Set |
from typing import Set |
||||
|
|
||||
from fastapi import FastAPI |
|
||||
from pydantic import BaseModel |
from pydantic import BaseModel |
||||
|
|
||||
|
from fastapi import FastAPI |
||||
|
|
||||
app = FastAPI() |
app = FastAPI() |
||||
|
|
||||
|
|
@ -1,8 +1,9 @@ |
|||||
from typing import Set |
from typing import Set |
||||
|
|
||||
from fastapi import FastAPI |
|
||||
from pydantic import BaseModel |
from pydantic import BaseModel |
||||
|
|
||||
|
from fastapi import FastAPI |
||||
|
|
||||
app = FastAPI() |
app = FastAPI() |
||||
|
|
||||
|
|
@ -1,8 +1,9 @@ |
|||||
from typing import Set |
from typing import Set |
||||
|
|
||||
from fastapi import FastAPI |
|
||||
from pydantic import BaseModel |
from pydantic import BaseModel |
||||
|
|
||||
|
from fastapi import FastAPI |
||||
|
|
||||
app = FastAPI() |
app = FastAPI() |
||||
|
|
||||
|
|
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue