﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
13814	Utility method for getting a Site object	James Bennett	Yuval Adam	"Fairly often, I find myself writing code which needs a `Site` and which, as a general best practice, falls back to `RequestSite` if `contrib.sites` isn't installed. Which means writing this code, or something like it, over and over:

{{{
from django.contrib.sites.models import RequestSite
from django.contrib.sites.models import Site

if Site._meta.installed:
    site = Site.objects.get_current()
else:
    site = RequestSite(some_request_object)
}}}

Given how common this idiom will be for code which wants to properly support the `RequestSite` fallback, it'd be nice to just have a utility method somewhere in `contrib.sites` which could just take an `HttpRequest` object and return either a `Site` or a `RequestSite` as appropriate."		closed	Contrib apps	1.2		duplicate			Unreviewed	1	0	0	0	0	0
