#31126 closed Cleanup/optimization (fixed)
Add a cross-reference to the staticfiles prefixes in the "Configuring static files" docs.
| 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 )
Currently, the Managing Static Files documentation page doesn't mention anything about namespaces (prefixes). It is logical to expect information regarding this on the page that deals with static files. However, the details are mentioned in Django Settings page under the setting.
I propose that the documentation be moved from Settings page to Managing Static Files page and add a link from the former to the latter. A quicker alternative would be the other way round.
Change History (6)
follow-up: 2 comment:1 by , 6 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 , 6 years ago
| Description: | modified (diff) |
|---|
Replying to felixxm:
IMO both docs are in the right places, moreover
howto/static-files/index.txtmentions namespaces in theStatic file namespacingadmonition. Nevertheless adding a cross reference to thedocs/ref/settings.txtseems 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.
comment:3 by , 6 years ago
| Description: | modified (diff) |
|---|
I removed the description in my previous comment by mistake. Sorry for that.
Adding it back in here.
IMO both docs are in the right places, moreover
howto/static-files/index.txtmentions namespaces in theStatic file namespacingadmonition. Nevertheless adding a cross reference to thedocs/ref/settings.txtseems 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) ~~~~~~~~~~~~~~~~~~~