Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 27 for from (0.17 sec)

  1. docs_src/settings/app03_an_py39/main.py

    from functools import lru_cache
    
    from fastapi import Depends, FastAPI
    from typing_extensions import Annotated
    
    from . import config
    
    app = FastAPI()
    
    
    @lru_cache
    def get_settings():
        return config.Settings()
    
    
    @app.get("/info")
    async def info(settings: Annotated[config.Settings, Depends(get_settings)]):
        return {
            "app_name": settings.app_name,
            "admin_email": settings.admin_email,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 462 bytes
    - Viewed (0)
  2. docs_src/bigger_applications/app/main.py

    from fastapi import Depends, FastAPI
    
    from .dependencies import get_query_token, get_token_header
    from .internal import admin
    from .routers import items, users
    
    app = FastAPI(dependencies=[Depends(get_query_token)])
    
    
    app.include_router(users.router)
    app.include_router(items.router)
    app.include_router(
        admin.router,
        prefix="/admin",
        tags=["admin"],
        dependencies=[Depends(get_token_header)],
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Nov 29 17:32:18 GMT 2020
    - 552 bytes
    - Viewed (0)
  3. docs_src/app_testing/app_b/main.py

    from typing import Union
    
    from fastapi import FastAPI, Header, HTTPException
    from pydantic import BaseModel
    
    fake_secret_token = "coneofsilence"
    
    fake_db = {
        "foo": {"id": "foo", "title": "Foo", "description": "There goes my hero"},
        "bar": {"id": "bar", "title": "Bar", "description": "The bartenders"},
    }
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        id: str
        title: str
        description: Union[str, None] = None
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Jan 09 14:44:08 GMT 2024
    - 1.1K bytes
    - Viewed (0)
  4. docs_src/settings/app02_an_py39/main.py

    from functools import lru_cache
    from typing import Annotated
    
    from fastapi import Depends, FastAPI
    
    from .config import Settings
    
    app = FastAPI()
    
    
    @lru_cache
    def get_settings():
        return Settings()
    
    
    @app.get("/info")
    async def info(settings: Annotated[Settings, Depends(get_settings)]):
        return {
            "app_name": settings.app_name,
            "admin_email": settings.admin_email,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 445 bytes
    - Viewed (0)
  5. .github/actions/people/app/main.py

    import logging
    import subprocess
    import sys
    from collections import Counter, defaultdict
    from datetime import datetime, timedelta, timezone
    from pathlib import Path
    from typing import Any, Container, DefaultDict, Dict, List, Set, Union
    
    import httpx
    import yaml
    from github import Github
    from pydantic import BaseModel, SecretStr
    from pydantic_settings import BaseSettings
    
    github_graphql_url = "https://api.github.com/graphql"
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 17:38:21 GMT 2024
    - 19.2K bytes
    - Viewed (1)
  6. .github/actions/notify-translations/app/main.py

    import logging
    import random
    import sys
    import time
    from pathlib import Path
    from typing import Any, Dict, List, Union, cast
    
    import httpx
    from github import Github
    from pydantic import BaseModel, BaseSettings, SecretStr
    
    awaiting_label = "awaiting-review"
    lang_all_label = "lang-all"
    approved_label = "approved-2"
    translations_path = Path(__file__).parent / "translations.yml"
    
    github_graphql_url = "https://api.github.com/graphql"
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Sep 27 23:01:46 GMT 2023
    - 12.4K bytes
    - Viewed (0)
  7. docs/extensions/s3zip/examples/boto3/main.py

    #!/usr/bin/env/python
    
    import boto3
    from botocore.client import Config
    
    s3 = boto3.client('s3',
            endpoint_url='http://localhost:9000',
            aws_access_key_id='YOUR-ACCESSKEYID',
            aws_secret_access_key='YOUR-SECRETACCESSKEY',
            config=Config(signature_version='s3v4'),
            region_name='us-east-1')
    
    
    def _add_header(request, **kwargs):
        request.headers.add_header('x-minio-extract', 'true')
    Python
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Aug 04 21:15:45 GMT 2021
    - 771 bytes
    - Viewed (0)
  8. docs_src/settings/app03_an/main.py

    from functools import lru_cache
    from typing import Annotated
    
    from fastapi import Depends, FastAPI
    
    from . import config
    
    app = FastAPI()
    
    
    @lru_cache
    def get_settings():
        return config.Settings()
    
    
    @app.get("/info")
    async def info(settings: Annotated[config.Settings, Depends(get_settings)]):
        return {
            "app_name": settings.app_name,
            "admin_email": settings.admin_email,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 451 bytes
    - Viewed (0)
  9. .github/actions/comment-docs-preview-in-pr/app/main.py

    import logging
    import sys
    from pathlib import Path
    from typing import Union
    
    import httpx
    from github import Github
    from github.PullRequest import PullRequest
    from pydantic import BaseModel, SecretStr, ValidationError
    from pydantic_settings import BaseSettings
    
    github_api = "https://api.github.com"
    
    
    class Settings(BaseSettings):
        github_repository: str
        github_event_path: Path
        github_event_name: Union[str, None] = None
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Jan 09 15:02:53 GMT 2024
    - 2.1K bytes
    - Viewed (0)
  10. docs_src/settings/app02_an/main.py

    from functools import lru_cache
    
    from fastapi import Depends, FastAPI
    from typing_extensions import Annotated
    
    from .config import Settings
    
    app = FastAPI()
    
    
    @lru_cache
    def get_settings():
        return Settings()
    
    
    @app.get("/info")
    async def info(settings: Annotated[Settings, Depends(get_settings)]):
        return {
            "app_name": settings.app_name,
            "admin_email": settings.admin_email,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 456 bytes
    - Viewed (0)
Back to top