Opened 6 years ago

Last modified 6 years ago

#29796 closed Cleanup/optimization

Report error if the prefix in the STATICFILES_DIRS ends with slash — at Initial Version

Reported by: Paweł Kołodziej Owned by: nobody
Component: contrib.staticfiles Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Problem:
With following config:

STATICFILES_DIRS=[ ('front/', os.path.join(BASE_DIR, 'front/build')) ]

files from 'front/build' are collected by 'manage.py collectstatic' but no served by 'runserver'.
The problem is caused by trailing slash in prefix ('front/' instead of 'front').

My first solution was to normalize the prefix, but it was suggested that it's better to report error.
(https://github.com/django/django/pull/10441)

I'm going to submit new patch soon.

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top