Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#15344 closed (worksforme)

STATIC_ROOT is not considered when serving static files with staticfiles_urlpatterns

Reported by: Carlo Pires Owned by: nobody
Component: Uncategorized Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

As django.contrib.staticfiles.finders.FileSystemFinder blocks settings.STATIC_ROOT to be on
settings.STATICFILES_DIR, django.contrib.staticfiles.finders.find() should consider settings.STATIC_ROOT on lookup for static files.

Change History (3)

comment:1 by Jannis Leidel, 14 years ago

Resolution: worksforme
Status: newclosed

I don't understand what setting STATIC_ROOT dynamically would bring.

To reiterate, STATIC_ROOT is not the file system location you put your static files into but where the staticfiles' app collectstatic management command copies files to. In other words, if you have separate directories you want the staticfiles app to consider to copy, just add those separate directories to the STATICFILES_DIRS setting. For example if you have a "project" static directory, e.g.:

STATIC_ROOT = "/var/www/static"
STATIC_URL = "/static/"
STATICFILES_DIRS = (
    "/path/to/my/site/project/static",
)

comment:2 by Carlo Pires, 14 years ago

This SHOULD be on documentation to avoid confusion:

"STATIC_ROOT is not the file system location you put your static files into but where the staticfiles' app collectstatic management command copies files to."

in reply to:  2 comment:3 by Jannis Leidel, 14 years ago

Replying to carlopires:

This SHOULD be on documentation to avoid confusion:

"STATIC_ROOT is not the file system location you put your static files into but where the staticfiles' app collectstatic management command copies files to."

This is covered here: http://docs.djangoproject.com/en/dev/ref/settings/#std:setting-STATIC_ROOT

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