Home / Function/ auto_find_instance_path() — flask Function Reference

auto_find_instance_path() — flask Function Reference

Architecture documentation for the auto_find_instance_path() function in app.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  5d914b38_d2af_c173_db31_3a2d1e8e567d["auto_find_instance_path()"]
  38f6d4a2_834e_2acd_e1b6_f45c58079ccd["App"]
  5d914b38_d2af_c173_db31_3a2d1e8e567d -->|defined in| 38f6d4a2_834e_2acd_e1b6_f45c58079ccd
  4b05301c_76b4_7bf6_5a71_e4588c1d623f["__init__()"]
  4b05301c_76b4_7bf6_5a71_e4588c1d623f -->|calls| 5d914b38_d2af_c173_db31_3a2d1e8e567d
  4edb5aa7_d577_d1ba_2a86_d1b146357835["find_package()"]
  5d914b38_d2af_c173_db31_3a2d1e8e567d -->|calls| 4edb5aa7_d577_d1ba_2a86_d1b146357835
  style 5d914b38_d2af_c173_db31_3a2d1e8e567d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/flask/sansio/app.py lines 507–518

    def auto_find_instance_path(self) -> str:
        """Tries to locate the instance path if it was not provided to the
        constructor of the application class.  It will basically calculate
        the path to a folder named ``instance`` next to your main file or
        the package.

        .. versionadded:: 0.8
        """
        prefix, package_path = find_package(self.import_name)
        if prefix is None:
            return os.path.join(package_path, "instance")
        return os.path.join(prefix, "var", f"{self.name}-instance")

Subdomains

Called By

Frequently Asked Questions

What does auto_find_instance_path() do?
auto_find_instance_path() is a function in the flask codebase, defined in src/flask/sansio/app.py.
Where is auto_find_instance_path() defined?
auto_find_instance_path() is defined in src/flask/sansio/app.py at line 507.
What does auto_find_instance_path() call?
auto_find_instance_path() calls 1 function(s): find_package.
What calls auto_find_instance_path()?
auto_find_instance_path() is called by 1 function(s): __init__.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free