Opened 11 years ago

Closed 11 years ago

#22109 closed Cleanup/optimization (wontfix)

clarify difference between relative and absolute STATIC_URL

Reported by: Chris Jerdonek Owned by: nobody
Component: Documentation Version: 1.6
Severity: Normal Keywords: static_url, static
Cc: chris.jerdonek@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

It seems like there is a qualitative difference in the behavior of STATIC_URL that is worth adding to its documentation -- depending on whether the URL is absolute vs relative. Specifically, the documentation currently only mentions how to refer to static assets (i.e. by prepending STATIC_URL). But it doesn't mention that when STATIC_URL is relative, Django will use this setting to find and serve the file (using also the settings STATICFILES_DIRS and STATIC_ROOT, for example).

Change History (4)

comment:1 by Chris Jerdonek, 11 years ago

Cc: chris.jerdonek@… added

comment:2 by Tim Graham, 11 years ago

I'm not quite sure what you are suggesting. Could you given an example or offer a patch?

comment:3 by Chris Jerdonek, 11 years ago

I can try to find time to come up with a patch. In the meantime, to say a little more about what I'm getting at, it turns out that the point I was trying to raise in this issue is discussed in the Django documentation, though not in the STATIC_URL documentation itself (which is supposed to contain details about the setting). Namely, the point is discussed here in the "The staticfiles app" section. For example, it says, "This helper function will only work if DEBUG is True and your STATIC_URL setting is neither empty nor a full URL such as http://static.example.com/."

In other words, the functionality I'm referencing only becomes enabled when STATIC_URL is a relative URL reference (i.e. does not contain the host name, etc).

comment:4 by Aymeric Augustin, 11 years ago

Resolution: wontfix
Status: newclosed

The docs for STATIC_URL link to the docs for the staticfiles app, which seems reasonable and DRY to me.

There's tons of useful information in the staticfiles docs, including but not limited to this one, and it isn't a good idea to duplicate it.

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