--
Ticket URL: <https://code.djangoproject.com/ticket/17802>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_docs: => 1
* resolution: => needsinfo
* needs_tests: => 1
* needs_better_patch: => 0
Comment:
This patch doesn't change anything to the public API. It only makes it
easier for developers to write subclasses of `Sitemap` (which isn't
officially supported).
If we decided to make this change, it would have to be tested. Otherwise,
it could be refactored away by mistake. We could also document more parts
of `Sitemap`, making them public APIs.
----
However, I'm not sure this patch is the best solution to the original
problem. If you "serve the same app under different domains", you must be
using different sites, which means different `settings.SITE_ID`. IMO you
should just change the output of your sitemaps based on the current site
(for the "different domains" part), or on another setting.
Tentatively closing "needsinfo", please reopen if that solution doesn't
work.
--
Ticket URL: <https://code.djangoproject.com/ticket/17802#comment:1>
* status: closed => new
* resolution: needsinfo =>
Comment:
Bump.
I'm using an own set request variable; request.LANGUAGE (based on TLD) to
select the content on my site, for example
Foo.objects.filter(language=request.LANGUAGE).
Sure this could be set with the Sites framework and use a Site for the
lookup instead, however this means I need to run a wsgi process for each
language (with different SITE_ID), if I were to add 20 languages for my
site with different content I then need to run 20 instances of django.
I'd prefer to add the request object to the Sitemap object instead.
I'm reopening, please consider this again.
--
Ticket URL: <https://code.djangoproject.com/ticket/17802#comment:2>
Comment (by rm_):
Replying to [comment:2 me@…]:
> I'm using an own set request variable; request.LANGUAGE (based on TLD)
to select the content on my site, for example
Foo.objects.filter(language=request.LANGUAGE).
>
> Sure this could be set with the Sites framework and use a Site for the
lookup instead, however this means I need to run a wsgi process for each
language (with different SITE_ID), if I were to add 20 languages for my
site with different content I then need to run 20 instances of django.
Share the same sentiments about SITE_ID
> I'm reopening, please consider this again.
Care to respin the patch with the tests aaugustin asked for?
--
Ticket URL: <https://code.djangoproject.com/ticket/17802#comment:3>
* needs_docs: 1 => 0
* needs_tests: 1 => 0
Comment:
I sent a pull request on github, the patch contains test and docs.
https://github.com/django/django/pull/2371
--
Ticket URL: <https://code.djangoproject.com/ticket/17802#comment:4>
Comment (by aaugustin):
Comments 2 and 3 look like they belong to #15089. The problem here isn't
sitemaps, it's multi-tenancy -- and it's a hard problem.
--
Ticket URL: <https://code.djangoproject.com/ticket/17802#comment:5>
* status: new => closed
* resolution: => duplicate
Comment:
I can't say what the proper solution is, but I'm afraid hardcoding a
sitemap-specific solution will only make proper multi-tenancy harder. I
think this requires a discussion on the DevelopersMailingList. See also
#22231.
--
Ticket URL: <https://code.djangoproject.com/ticket/17802#comment:6>
* status: closed => new
* resolution: duplicate =>
Comment:
Err. Didn't mean to close it.
--
Ticket URL: <https://code.djangoproject.com/ticket/17802#comment:7>
Comment (by rm_):
Replying to [comment:6 aaugustin]:
> I can't say what the proper solution is, but I'm afraid hardcoding a
sitemap-specific solution will only make proper multi-tenancy harder. I
think this requires a discussion on the DevelopersMailingList. See also
#22231.
>
Thanks for your comment Aymeric. Proper multi tenancy in django would be
very cool (at the time liked a lot alex gaynor's talk [1] about getting
the application state from the request) but just adding an attribute to a
class it's fixing the issue for at least a couple of us in quite an
unobtrusive way.
[1] https://speakerdeck.com/alex/take-2-if-i-got-to-do-django-all-over-
again
--
Ticket URL: <https://code.djangoproject.com/ticket/17802#comment:8>
Comment (by rm_):
Replying to [comment:6 aaugustin]:
> I can't say what the proper solution is, but I'm afraid hardcoding a
sitemap-specific solution will only make proper multi-tenancy harder. I
think this requires a discussion on the DevelopersMailingList. See also
#22231.
So tried to open a discussion on mailing list few weeks ago without much
success. The side effect though is that i'm very much interested in the
patch [2] attached to #15089 [3] which make this #17802 ticket obsolete.
Aymeric, any chance you can review the patch?
[1] https://groups.google.com/forum/#!topic/django-developers/ORo_28B_VIA
[2] https://code.djangoproject.com/attachment/ticket/15089/0001-Make-
settings.SITE_ID-optional-for-django.contrib.si.patch
[3] https://code.djangoproject.com/ticket/15089
--
Ticket URL: <https://code.djangoproject.com/ticket/17802#comment:9>
* status: new => closed
* resolution: => duplicate
Comment:
If this ticket will be obsoleted by #15089, then I guess we can close this
as a duplicate.
--
Ticket URL: <https://code.djangoproject.com/ticket/17802#comment:10>