Sunday, September 30, 2018

Extending contrib.sites.get_current_site logic

What is the best-practice pattern to replace/extend functionality in django.contrib libraries?

My use case in this instance is to add domain alias awareness to the contrib.sites library. I've already created a customized sites library that incorporates the additional model updates and logic we need, but other third-party libraries we use (allauth, for example) are directly calling django.django.contrib.sites.models.objects.get_current(). We've begun maintaining a local fork of each of these libraries to update the call to point to our customized sites lib instead. Is there a more efficient solution for this?

You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment