Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 31 - 40 of 54 for appName (0.07 seconds)

  1. docs_src/settings/app02_py39/test_main.py

    
    app.dependency_overrides[get_settings] = get_settings_override
    
    
    def test_app():
        response = client.get("/info")
        data = response.json()
        assert data == {
            "app_name": "Awesome API",
            "admin_email": "******@****.***",
            "items_per_user": 50,
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 515 bytes
    - Click Count (0)
  2. docs/en/docs/advanced/settings.md

    ///
    
    Then, when you create an instance of that `Settings` class (in this case, in the `settings` object), Pydantic will read the environment variables in a case-insensitive way, so, an upper-case variable `APP_NAME` will still be read for the attribute `app_name`.
    
    Next it will convert and validate the data. So, when you use that `settings` object, you will have data of the types you declared (e.g. `items_per_user` will be an `int`).
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 20 15:55:38 GMT 2025
    - 11.2K bytes
    - Click Count (0)
  3. docs_src/settings/app02_an_py39/test_main.py

    
    app.dependency_overrides[get_settings] = get_settings_override
    
    
    def test_app():
        response = client.get("/info")
        data = response.json()
        assert data == {
            "app_name": "Awesome API",
            "admin_email": "******@****.***",
            "items_per_user": 50,
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 515 bytes
    - Click Count (0)
  4. tests/test_tutorial/test_settings/test_tutorial001.py

        return mod.app
    
    
    def test_settings(app):
        client = TestClient(app)
        response = client.get("/info")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "app_name": "Awesome API",
            "admin_email": "******@****.***",
            "items_per_user": 50,
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 27 12:54:56 GMT 2025
    - 690 bytes
    - Click Count (0)
  5. docs_src/settings/app03_py39/config.py

    from pydantic_settings import BaseSettings, SettingsConfigDict
    
    
    class Settings(BaseSettings):
        app_name: str = "Awesome API"
        admin_email: str
        items_per_user: int = 50
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 235 bytes
    - Click Count (0)
  6. docs_src/settings/app03_py39/config_pv1.py

    from pydantic.v1 import BaseSettings
    
    
    class Settings(BaseSettings):
        app_name: str = "Awesome API"
        admin_email: str
        items_per_user: int = 50
    
        class Config:
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 20 15:55:38 GMT 2025
    - 198 bytes
    - Click Count (0)
  7. docs/zh/docs/advanced/settings.md

    然后,它将转换和验证数据。因此,当您使用该 `settings` 对象时,您将获得您声明的类型的数据(例如 `items_per_user` 将为 `int` 类型)。
    
    ### 使用 `settings`
    
    然后,您可以在应用程序中使用新的 `settings` 对象:
    
    {* ../../docs_src/settings/tutorial001.py hl[18:20] *}
    
    ### 运行服务器
    
    接下来,您将运行服务器,并将配置作为环境变量传递。例如,您可以设置一个 `ADMIN_EMAIL` 和 `APP_NAME`,如下所示:
    
    <div class="termy">
    
    ```console
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Mon Nov 18 02:25:44 GMT 2024
    - 12.7K bytes
    - Click Count (0)
  8. cmd/metrics-v3-system-drive.go

    	// Append the api label for the drive API latencies.
    	labels = append(labels, "api", "")
    	lastIdx := len(labels) - 1
    	for apiName, latency := range disk.Metrics.LastMinute {
    		labels[lastIdx] = "storage." + apiName
    		m.Set(driveAPILatencyMicros, float64(latency.Avg().Microseconds()),
    			labels...)
    	}
    }
    
    Created: Sun Dec 28 19:28:13 GMT 2025
    - Last Modified: Sun Mar 30 00:56:02 GMT 2025
    - 7.8K bytes
    - Click Count (0)
  9. android-test-app/src/main/AndroidManifest.xml

      <uses-permission android:name="android.permission.INTERNET" />
    
      <application
        android:allowBackup="true"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:name=".TestApplication"
      >
        <activity
          android:name=".MainActivity"
          android:exported="true">
          <intent-filter>
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Tue Aug 19 08:10:39 GMT 2025
    - 992 bytes
    - Click Count (0)
  10. tests/test_tutorial/test_settings/test_app02.py

        return test_main_mod
    
    
    def test_settings(main_mod: ModuleType, monkeypatch: MonkeyPatch):
        monkeypatch.setenv("ADMIN_EMAIL", "******@****.***")
        settings = main_mod.get_settings()
        assert settings.app_name == "Awesome API"
        assert settings.items_per_user == 50
    
    
    def test_override_settings(test_main_mod: ModuleType):
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 20 15:55:38 GMT 2025
    - 1K bytes
    - Click Count (0)
Back to Top