#10909 closed (fixed)
Allow use of the Sitemaps Framework without requiring the sites contrib application
Reported by: | QingFeng | Owned by: | nobody |
---|---|---|---|
Component: | Contrib apps | Version: | dev |
Severity: | Keywords: | ||
Cc: | qingfeng@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Django Sitemaps Framework does not allow the use of the Domain Settings Site
In settings.py add a variable DOMAIN
DOMAIN = 'www.example.com'
example:
location of the place, do not rely on the domain name Site Settings
class KhufuSitemap(Sitemap): changefreq = "never" priority = 0.5 def items(self): return [obj,obj,obj] def location(self,obj): return "/v/%s/" % obj["kid"] def lastmod(self, obj): return datetime.strptime(obj["savedate"],'%Y-%m-%d')
Attachments (4)
Change History (15)
by , 16 years ago
Attachment: | sitemaps.patch added |
---|
follow-up: 2 comment:1 by , 16 years ago
comment:2 by , 16 years ago
Replying to Tarken:
I won't close this myself, as I have no official word in the development of Django... but this appears to be invalid.
DOMAIN is not a setting which is currently set or used anywhere else in Django. Nor does it appear to really be necessary. Django can't account for every setting that you may add to your project.
:)To do so is to facilitate, as some projects with less than a database, the current code can not output the Sitemap
comment:4 by , 16 years ago
Keywords: | sitemaps removed |
---|---|
Needs documentation: | set |
Summary: | Django Sitemaps Framework does not allow the use of the Domain Settings Site → Allow use of the Sitemaps Framework without requiring the sites contrib application |
Triage Stage: | Unreviewed → Accepted |
Version: | 1.0 → SVN |
It's a useful idea, but adding a setting isn't the way to go about it. I'm attaching a better version - it just needs docs if someone wants to write them.
by , 16 years ago
Attachment: | 10909.diff added |
---|
comment:5 by , 15 years ago
milestone: | → 1.2 |
---|
comment:6 by , 15 years ago
milestone: | 1.2 → 1.3 |
---|---|
Needs documentation: | unset |
Added docs & tests (plus SmileyChris' patch).
by , 15 years ago
Attachment: | sitemaps_custom_domain_docs_tests.diff added |
---|
And now with a docstring (docs+tests).
comment:8 by , 14 years ago
comment:9 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [13980]) Fixed #14386, #8960, #10235, #10909, #10608, #13845, #14377 - standardize Site/RequestSite usage in various places.
Many thanks to gabrielhurley for putting most of this together. Also to
bmihelac, arthurk, qingfeng, hvendelbo, petr.pulc@…, Hraban for
reports and some initial patches.
The patch also contains some whitespace/PEP8 fixes.
comment:10 by , 14 years ago
(In [13987]) [1.2.X] Fixed #14386, #8960, #10235, #10909, #10608, #13845, #14377 - standardize Site/RequestSite usage in various places.
Many thanks to gabrielhurley for putting most of this together. Also to
bmihelac, arthurk, qingfeng, hvendelbo, petr.pulc@…, Hraban for
reports and some initial patches.
The patch also contains some whitespace/PEP8 fixes.
Backport of [13980] from trunk. Some items could be considered features
(i.e. supporting RequestSite in various contrib apps), others are definite
bugs, but it was much more robust to backport all these tightly related
changes together.
I won't close this myself, as I have no official word in the development of Django... but this appears to be invalid.
DOMAIN is not a setting which is currently set or used anywhere else in Django. Nor does it appear to really be necessary. Django can't account for every setting that you may add to your project.