Skip to content

Changing the name parameter to required. #399

Closed
@T4rk1n

Description

@T4rk1n

@ned2 and I had a thread on the assets_folder parameter being absolute if you provide it. We thought it would be better if it would conform to how flask handles the static folder relative to the module.

Turns out the blueprint static folder is activated by __name__ but I put assets as the parameter so it cannot find the root folder unless a module is named assets then it will take that path. This make the assets folder be absolute instead of relative to the module directory.

When I tested to make it relative, it broke if you didn't explicitly put the __name__ in the dash constructor because of our default of __main__. If we replace the default by an empty string it works (it will fallback to os.cwd) but it might be too brittle and dependent on the os.

I think requiring the import_name like flask does would solve that issue and we would always be sure to have the right folder relative to the running project.

This would be a breaking change and would go in Dash 2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions