Opened 11 years ago

Closed 11 years ago

Last modified 11 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: 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

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 ] https://docs.djangoproject.com/en/dev/howto/static-files/#serving-files-uploaded-by-a-user
[ 2 ] https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi/#serving-the-admin-files

Change History (4)

comment:1 by Tim Graham, 11 years ago

Easy pickings: unset
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

comment:2 by Tim Graham, 11 years ago

Has patch: set

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

Resolution: fixed
Status: newclosed

In 7b04038a7f4b291bc05124c4b5300001dc94e13f:

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

comment:4 by Tim Graham <timograham@…>, 11 years ago

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