Search code examples
djangocollectstatic

Collectstatic referencing to wrong path to folder


When executing the command 'collectstatic', python looks into the wrong folder, Dev/staticfiles, when my staticfiles are saved in the folder: [..]/Dev/bidding_tool_project/project/staticfiles

Would you have any idea how/why this happens?


Solution

  • An other SO answer helped: os.path.join considers anything after a slash as being an absolute path. When using os.path.join, the path should be declared as: STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') and not STATIC_ROOT = os.path.join(BASE_DIR, 'project/staticfiles')

    the post that helped me: Why doesn't os.path.join() work in this case?