Opened 5 years ago
Last modified 5 years ago
#31126 closed Cleanup/optimization
Add a cross-reference to the staticfiles prefixes in the "Configuring static files" docs. — at Version 2
Reported by: | Abhijeet Viswa | Owned by: | Abhijeet Viswa |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | documentation, static-files |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description (last modified by )
Change History (2)
follow-up: 2 comment:1 by , 5 years ago
Summary: | Document static file namespaces (prefixes) in Managing Static Files documentation → Add a cross-reference to the staticfiles prefixes in the "Configuring static files" docs. |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 5 years ago
Description: | modified (diff) |
---|
Replying to felixxm:
IMO both docs are in the right places, moreover
howto/static-files/index.txt
mentions namespaces in theStatic file namespacing
admonition. Nevertheless adding a cross reference to thedocs/ref/settings.txt
seems like a good idea, e.g.
--- a/docs/howto/static-files/index.txt +++ b/docs/howto/static-files/index.txt distinguish between them. We need to be able to point Django at the right - one, and the best way to ensure this is by *namespacing* them. That is, - by putting those static files inside *another* directory named for the - application itself. + one, and the best way to ensure this is by :ref:`namespacing them + <staticfiles-dirs-prefixes>`. That is, by putting those static files inside + *another* directory named for the application itself. --- a/docs/ref/settings.txt +++ b/docs/ref/settings.txt +.. _staticfiles-dirs-prefixes: + Prefixes (optional) ~~~~~~~~~~~~~~~~~~~
The Static file namespacing
admonition in howto/static-files/index.txt
mentions namespaces in relation with static files for a particular app (my_app/static
). I am talking about prefixes in context of FileSystemFinder
and the STATICFILE_DIRS
setting.
The reason why I speak of prefixes in particular is because I had a particular case where I needed them to be served as static files and at the same time include them in a meaningful directory structure of my code repository. The default action is the contents of the files are moved to the STATIC_ROOT
folder. Using prefixes meant I could namespace the static files properly and hence link to them (from outside templates) using straight forward and intutive links.
I'll have a patch ready by tonight.
IMO both docs are in the right places, moreover
howto/static-files/index.txt
mentions namespaces in theStatic file namespacing
admonition. Nevertheless adding a cross reference to thedocs/ref/settings.txt
seems like a good idea, e.g.