Velvet: Static Files are searched by path string in urls

This issue refers to Velvet - Django Bootstrap 5 Premium Admin & Dashboard Template

If you add a new URL

urlpatterns = [
    path(
        "dashboard/", views.velvet_dashboard, name="dashboard"
    ),  # this finds  Not Found: /dashboard/static/assets/libs/bootstrap/css/bootstrap.rtl.min.css
    path(
        "", views.velvet_dashboard, name="dashboard"
    ),  # this finds  Not Found: /static/assets/libs/bootstrap/css/bootstrap.rtl.min.css
]

You can test it if you choose the Directions: RTL. logs for http://localhost:8000/: INFO 2025-10-16 08:24:43,331 basehttp 901281 124358292928064 "GET /static/assets/libs/bootstrap/css/bootstrap.rtl.min.css HTTP/1.1" 200 232911

logs for http://localhost:8000/dashboard/: WARNING 2025-10-16 08:34:37,514 log 902757 140627449730624 Not Found: /dashboard/static/assets/libs/bootstrap/css/bootstrap.rtl.min.css WARNING 2025-10-16 08:34:37,515 basehttp 902757 140627449730624 "GET /dashboard/static/assets/libs/bootstrap/css/bootstrap.rtl.min.css HTTP/1.1" 404 429

The issue comes from how static URLs are defined in the JS files.

enter image description here

These files should be fixed.
They should include a leading slash to correctly resolve the static path.

static/assets

whenever it used to:

/static/assets/

Example (in authentication-main.js):

    function ltrFn() {
        let html = document.querySelector('html')
        if(!document.querySelector("#style").href.includes('bootstrap.min.css')){
            document
                .querySelector("#style")
                // ?.setAttribute("href", "static/assets/libs/bootstrap/css/bootstrap.min.css");
                ?.setAttribute("href", "/static/assets/libs/bootstrap/css/bootstrap.min.css");
        }
        html.setAttribute("dir", "ltr");
    }
Вернуться на верх