pythondjangodjango-static

How to add static files for a specific path in django


I am a noob when it comes to django or any backend related programs. i would like to add the same static files for a path which is not home in my django project.

Here I am in my howe directory and there is no issues with loading static css and js file.home page but if i try to move to another pathother link static file are not loading. how can i load same static files but for different url other than the homepage

I even added another folder named loading in my working dir but am still unsuccessful


Solution

  • Django By default takes a static path from app directory, But you can change your custom static path like this...

    If you go with the default path then the below setting works fine.

    STATIC_URL = '/static/'
    

    If you want to set your custom static path then you need to add the below line.

    STATICFILES_DIRS = ['relative path of your static folder']