According feed_url, EasyFeed can auto get the domain field, and you can also specify the domain parameter.(feed_url should be a full domain path, so you can use Get the full request path to get the full path of the feed url.)

fromdjango.utilsimportfeedgeneratorfromdjango.confimportsettingsfromdjango.httpimportHttpResponsefromdjango.utils.feedgeneratorimportAtom1Feeddefrender_feed(feed):feedgen=feed.get_feed()response=HttpResponse(mimetype=feedgen.mime_type)feedgen.write(response,'utf-8')returnresponsedefadd_domain(domain,url,prefix):ifurl.startswith('/'):url=url[1:]ifnoturl.startswith('http://'):ifprefix:url=u'%s/%s/%s'%(domain,prefix,url)else:url=u'%s/%s'%(domain,url)returnurlclassEasyFeed(object):item_pubdate=Noneitem_enclosure_url=Nonefeed_type=Atom1Feeddef__init__(self,feed_url,domain='',prefix=''):self.domain=domainifnotself.domain:importurlparsev=urlparse.urlparse(feed_url)self.domain=v[0]+'://'+v[1]ifnotself.domain.startswith('http://'):self.domain='http://'+self.domainifself.domain.endswith('/'):self.domain=self.domain[:-1]self.feed_url=feed_urlself.prefix=prefixdef__get_dynamic_attr(self,attname,obj=None,default=None):value=''try:attr=getattr(self,attname)exceptAttributeError:value=defaultelse:ifcallable(attr):# Check func_code.co_argcount rather than try/excepting the# function and catching the TypeError, because something inside# the function may raise the TypeError. This technique is more# accurate.ifhasattr(attr,'func_code'):argcount=attr.func_code.co_argcountelse:argcount=attr.__call__.func_code.co_argcountifargcount==2:# one argument is 'self'value=attr(obj)else:value=attr()ifisinstance(value,str):value=unicode(value,settings.DEFAULT_CHARSET)returnvaluedefget_feed(self):""" Returns a feedgenerator.DefaultFeed object, fully populated, for this feed. """feed=self.feed_type(title=self.__get_dynamic_attr('title'),link=add_domain(self.domain,self.__get_dynamic_attr('link',default=''),self.prefix),description=self.__get_dynamic_attr('description'),language=settings.LANGUAGE_CODE.decode(),feed_url=add_domain(self.domain,self.feed_url,self.prefix),author_name=self.__get_dynamic_attr('author_name'),author_link=self.__get_dynamic_attr('author_link'),author_email=self.__get_dynamic_attr('author_email'),)foriteminself.items():link=add_domain(self.domain,self.__get_dynamic_attr('item_link',item),self.prefix)enc=Noneenc_url=self.__get_dynamic_attr('item_enclosure_url',item)ifenc_url:enc=feedgenerator.Enclosure(url=enc_url.decode('utf-8'),length=str(self.__get_dynamic_attr('item_enclosure_length',item)).decode('utf-8'),mime_type=self.__get_dynamic_attr('item_enclosure_mime_type',item).decode('utf-8'),)author_name=self.__get_dynamic_attr('item_author_name',item)ifauthor_nameisnotNone:author_email=self.__get_dynamic_attr('item_author_email',item)author_link=self.__get_dynamic_attr('item_author_link',item)else:author_email=author_link=Nonefeed.add_item(title=self.__get_dynamic_attr('item_title',item),link=link,description=self.__get_dynamic_attr('item_description',item),unique_id=link,enclosure=enc,pubdate=self.__get_dynamic_attr('item_pubdate',item),author_name=author_name,author_email=author_email,author_link=author_link,)returnfeeddefitems(self):raiseException,'Not Implemented'