Opened 6 years ago

Closed 6 years ago

#29796 closed Cleanup/optimization (fixed)

Add a system check error if the prefix in the STATICFILES_DIRS ends with slash

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 (last modified by Tim Graham)

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.

PR

Change History (2)

comment:1 by Tim Graham, 6 years ago

Description: modified (diff)
Summary: Report error if the prefix in the STATICFILES_DIRS ends with slashAdd a system check error if the prefix in the STATICFILES_DIRS ends with slash
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

comment:2 by Tim Graham <timograham@…>, 6 years ago

Resolution: fixed
Status: newclosed

In 05c578bc:

Fixed #29796 -- Added system check for STATICFILES_DIRS prefix ending with a slash.

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