Opened 7 years ago

Closed 7 years ago

#9724 closed (fixed)

Clarification on Serving Static Files documentation

Reported by: shacker 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: UI/UX:

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

Download all attachments as: .zip

Change History (8)

Changed 7 years ago by shacker

One-liner addition on docs for serving static files

Changed 7 years ago by shacker

One-liner addition on docs for serving static files

comment:1 Changed 7 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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

Changed 7 years ago by shacker

Correct way to import settings

comment:2 Changed 7 years ago by shacker

static3.diff corrects this problem. Thanks for clarifying.

comment:3 Changed 7 years ago by Alex

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

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

comment:4 Changed 7 years ago by shacker

  • Resolution invalid deleted
  • Status changed from closed to reopened

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 7 years ago by gwilson

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

(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