Opened 10 years ago

Closed 10 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 10 years ago.
One-liner addition on docs for serving static files
static.2.diff (426 bytes) - added by Scot Hacker 10 years ago.
One-liner addition on docs for serving static files
static3.diff (434 bytes) - added by Scot Hacker 10 years ago.
Correct way to import settings

Download all attachments as: .zip

Change History (8)

Changed 10 years ago by Scot Hacker

Attachment: static.diff added

One-liner addition on docs for serving static files

Changed 10 years ago by Scot Hacker

Attachment: static.2.diff added

One-liner addition on docs for serving static files

comment:1 Changed 10 years ago by Alex Gaynor

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

Changed 10 years ago by Scot Hacker

Attachment: static3.diff added

Correct way to import settings

comment:2 Changed 10 years ago by Scot Hacker

static3.diff corrects this problem. Thanks for clarifying.

comment:3 Changed 10 years ago by Alex Gaynor

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 Changed 10 years ago by Scot Hacker

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 Changed 10 years ago by Gary Wilson

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