Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 384 for Onot (0.15 sec)

  1. tests/test_starlette_exception.py

    app = FastAPI()
    
    items = {"foo": "The Foo Wrestlers"}
    
    
    @app.get("/items/{item_id}")
    async def read_item(item_id: str):
        if item_id not in items:
            raise HTTPException(
                status_code=404,
                detail="Item not found",
                headers={"X-Error": "Some custom header"},
            )
        return {"item": items[item_id]}
    
    
    @app.get("/http-no-body-statuscode-exception")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 7.4K bytes
    - Viewed (0)
  2. docs/en/docs/how-to/nosql-databases-couchbase.md

    ```
    
    ### f-strings
    
    If you are not familiar with the `f"userprofile::{username}"`, it is a Python "<a href="https://docs.python.org/3/glossary.html#term-f-string" class="external-link" target="_blank">f-string</a>".
    
    Any variable that is put inside of `{}` in an f-string will be expanded / injected in the string.
    
    ### `dict` unpacking
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Jan 16 13:23:25 GMT 2024
    - 6K bytes
    - Viewed (0)
  3. docs_src/security/tutorial005_an.py

            user_dict = db[username]
            return UserInDB(**user_dict)
    
    
    def authenticate_user(fake_db, username: str, password: str):
        user = get_user(fake_db, username)
        if not user:
            return False
        if not verify_password(password, user.hashed_password):
            return False
        return user
    
    
    def create_access_token(data: dict, expires_delta: Union[timedelta, None] = None):
        to_encode = data.copy()
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 5.3K bytes
    - Viewed (0)
  4. .github/actions/notify-translations/app/main.py

        label_strs = {label.name for label in pr.get_labels()}
        langs = []
        for label in label_strs:
            if label.startswith("lang-") and not label == lang_all_label:
                langs.append(label[5:])
        logging.info(f"PR #{pr.number} has labels: {label_strs}")
        if not langs or lang_all_label not in label_strs:
            logging.info(f"PR #{pr.number} doesn't seem to be a translation PR, skipping")
            sys.exit(0)
    
    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)
  5. docs_src/security/tutorial004_an_py310.py

            user_dict = db[username]
            return UserInDB(**user_dict)
    
    
    def authenticate_user(fake_db, username: str, password: str):
        user = get_user(fake_db, username)
        if not user:
            return False
        if not verify_password(password, user.hashed_password):
            return False
        return user
    
    
    def create_access_token(data: dict, expires_delta: timedelta | None = None):
        to_encode = data.copy()
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_security/test_tutorial005_py39.py

    
    @needs_py39
    def test_no_token(client: TestClient):
        response = client.get("/users/me")
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Not authenticated"}
        assert response.headers["WWW-Authenticate"] == "Bearer"
    
    
    @needs_py39
    def test_token(client: TestClient):
        access_token = get_access_token(scope="me", client=client)
        response = client.get(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.3K bytes
    - Viewed (0)
  7. .github/ISSUE_TEMPLATE/privileged.yml

    name: Privileged
    description: You are @tiangolo or he asked you directly to create an issue here. If not, check the other options. 👇
    body:
      - type: markdown
        attributes:
          value: |
            Thanks for your interest in FastAPI! 🚀
    
    Others
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Jan 31 14:02:52 GMT 2023
    - 889 bytes
    - Viewed (0)
  8. docs_src/additional_responses/tutorial003.py

    class Message(BaseModel):
        message: str
    
    
    app = FastAPI()
    
    
    @app.get(
        "/items/{item_id}",
        response_model=Item,
        responses={
            404: {"model": Message, "description": "The item was not found"},
            200: {
                "description": "Item requested by ID",
                "content": {
                    "application/json": {
                        "example": {"id": "bar", "value": "The bar tenders"}
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 837 bytes
    - Viewed (0)
  9. docs_src/dependencies/tutorial008b_an_py39.py

    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
        if item_id not in data:
            raise HTTPException(status_code=404, detail="Item not found")
        item = data[item_id]
        if item["owner"] != username:
            raise OwnerError(username)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Dec 26 20:37:34 GMT 2023
    - 775 bytes
    - Viewed (0)
  10. docs/en/docs/deployment/https.md

    * Otherwise, you might have to stop the TLS Termination Proxy momentarily, start the renewal program to acquire the certificates, then configure them with the TLS Termination Proxy, and then restart the TLS Termination Proxy. This is not ideal, as your app(s) will not be available during the time that the TLS Termination Proxy is off.
    
    All this renewal process, while still serving the app, is one of the main reasons why you would want to have a **separate system to handle HTTPS** with a...
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jan 11 16:31:18 GMT 2024
    - 12K bytes
    - Viewed (0)
Back to top