It'd be helpful to add this information into a context processor for easy access from your templates.
To get the current site information:
1.
from
django.contrib.sites.models
import
Site
2.
3.
site
=
Site.objects.get_current()
Use "site.domain" to retrieve the domain.
To get the current requested URL:
1.
request.REQUEST.get(
'page'
)
or
request.META.get(
'PATH_INFO'
)
or
""
The HTTP_REFERER is accessible through:
1.
request.META.get(
'HTTP_REFERER'
, "")
And the query args:
1.
request.GET.urlencode
Reminder: All of the .get() functions may return None, so either give it a default value of "" or allow for null values in your models.