Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#20973 closed Cleanup/optimization (fixed)

Improve docs about handling static files without django.contrib.staticfiles.

Reported by: loic84 Owned by: nobody
Component: Documentation Version: master
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


Following discussion on IRC with @apollo13 and @ubernostrum.

Since django.contrib.staticfiles is optional, we should document how to serve STATIC_URL without it during development; the docs for serving MEDIA_URL [ 1 ] may be used as a template.

Some parts of the docs need to be reviewed; for example "Note that the Django development server automatically serves the static files of the admin app (and any other installed apps)" [ 2 ] is actually only true if django.contrib.staticfiles is installed.

It might be helpful to warn that MEDIA_URL and STATIC_URL must have different values, the same applies to MEDIA_ROOT and STATIC_ROOT. This is mostly an issue because historically (pre-contrib.staticfiles) a lot of projects were using MEDIA_ROOT/MEDIA_URL to serve static files.

[ 1 ]
[ 2 ]

Change History (4)

comment:1 Changed 3 years ago by timo

  • Easy pickings unset
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted
  • Type changed from Uncategorized to Cleanup/optimization

comment:2 Changed 3 years ago by timo

  • Has patch set

comment:3 Changed 3 years ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from new to closed

In 7b04038a7f4b291bc05124c4b5300001dc94e13f:

Fixed #20973 -- Document serving static files without django.contrib.staticfiles

comment:4 Changed 3 years ago by Tim Graham <timograham@…>

In a62b640f7d3a0b90c4009cc7efe0a19fd3ad0bfa:

[1.6.x] Fixed #20973 -- Document serving static files without django.contrib.staticfiles

Backport of 7b04038a7f from master

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