Opened 16 years ago

Closed 16 years ago

#9724 closed (fixed)

Clarification on Serving Static Files documentation

Reported by: Scot Hacker Owned by: nobody
Component: Documentation Version: 1.0
Severity: Keywords: static
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

http://docs.djangoproject.com/en/dev/howto/static-files/ mentions a method for defining a media dir in settings.py and urls.py that will work with both runserver and a production server, but leaves out a critical line for those not familiar with how to access objects from settings. This minor doc patch corrects that.

Attachments (3)

static.diff (426 bytes ) - added by Scot Hacker 16 years ago.
One-liner addition on docs for serving static files
static.2.diff (426 bytes ) - added by Scot Hacker 16 years ago.
One-liner addition on docs for serving static files
static3.diff (434 bytes ) - added by Scot Hacker 16 years ago.
Correct way to import settings

Download all attachments as: .zip

Change History (8)

by Scot Hacker, 16 years ago

Attachment: static.diff added

One-liner addition on docs for serving static files

by Scot Hacker, 16 years ago

Attachment: static.2.diff added

One-liner addition on docs for serving static files

comment:1 by Alex Gaynor, 16 years ago

That's not the correct way to import settings, you should be doing from django.conf import settings

by Scot Hacker, 16 years ago

Attachment: static3.diff added

Correct way to import settings

comment:2 by Scot Hacker, 16 years ago

static3.diff corrects this problem. Thanks for clarifying.

comment:3 by Alex Gaynor, 16 years ago

Resolution: invalid
Status: newclosed

Not sure how I missed it earlier, but the import is already in the codeblock. I'm therefore marking this invalid.

comment:4 by Scot Hacker, 16 years ago

Resolution: invalid
Status: closedreopened

The import is in the codeblock for the section "Limiting use to DEBUG=True" at the bottom of the page, but not in the section "How to do it" at mid-page - that's what this patch is for.

comment:5 by Gary Wilson, 16 years ago

Resolution: fixed
Status: reopenedclosed

(In [9598]) [1.0.X] Fixed #9724 -- Added missing import to URLconf example, thanks shacker.

Backport of r9597 from trunk.

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