Re: RSS producing wrong link from get_absolute url
Thanks. That sorted it. It was the database. Ironically, the sites have disappeared from the admin app since upgrading to 1.0 from 0.96 so haven't seen them for a while. I had to update via SQL. I will look into why they disappeared. On 3 Apr, 07:14, Alex Koshelevwrote: > Have you changed your `Site` model entry to the proper port number? > > On Fri, Apr 3, 2009 at 2:23 AM, John Baker wrote: > > > I have a strange problem with simple RSS feeds. It works fine locally > > on my development machine but when I deploy to the test server running > > through mod_python on port :81 the blog item links miss out the port > > number and so don't work. > > > Test server with new RSS code.. > >http://www.adrem.uk.com:81/feeds/blog/ > > > The links become (cutting out the port number!!!) > >http://www.adrem.uk.com/blog/79/ > > > Here are code snippets.. Help! Anyone got any ideas?? It is pretty > > strange.. > > -- > > feeds = { > > 'blog':BlogFeed, > > 'jobs': JobsFeed, > > } > > -- > > (r'^feeds/(?P.*)/$', 'django.contrib.syndication.views.feed', > > {'feed_dict': feeds}), > > (r'^blog/(?P\d+)/$', adrem.views.news_item), > > -- > > classBlogFeed(Feed): > > title = "www.adrem.uk.comblog rss feed" > > link = settings.SITE_BASE > > description = "The latest adrem blogs" > > > def items(self, obj): > > return NewsItem.objects.order_by('-posted')[:20] > > -- > > class NewsItem(models.Model): > > category = models.ForeignKey(NewsCategory) > > show_in_all = models.BooleanField(default=False, > > help_text="This only applies to the two original news categories (main > > and dreamspace)") > > posted = models.DateField() > > headline = models.CharField(max_length=200) > > story = models.TextField() > > primary_picture = models.ImageField(upload_to="uploads/model/ > > newsitem_pictures/", blank=True, null=True) > > secondary_picture = models.ImageField(upload_to="uploads/model/ > > newsitem_pictures/", blank=True, null=True) > > > def get_absolute_url(self): > > return urlresolvers.reverse("adremsite.adrem.views.news_item", > > kwargs={"newsitem_id": self.id}) > > > def __unicode__(self): > > return "%s: %s" % (self.posted, self.headline) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: RSS producing wrong link from get_absolute url
What do you have 'django.root' option set to in Apache configuration related to mod_python? Graham On Apr 3, 9:23 am, John Bakerwrote: > I have a strange problem with simple RSS feeds. It works fine locally > on my development machine but when I deploy to the test server running > through mod_python on port :81 the blog item links miss out the port > number and so don't work. > > Test server with new RSS code..http://www.adrem.uk.com:81/feeds/blog/ > > The links become (cutting out the port > number!!!)http://www.adrem.uk.com/blog/79/ > > Here are code snippets.. Help! Anyone got any ideas?? It is pretty > strange.. > -- > feeds = { > 'blog': BlogFeed, > 'jobs': JobsFeed,} > > -- > (r'^feeds/(?P.*)/$', 'django.contrib.syndication.views.feed', > {'feed_dict': feeds}), > (r'^blog/(?P\d+)/$', adrem.views.news_item), > -- > class BlogFeed(Feed): > title = "www.adrem.uk.comblog rss feed" > link = settings.SITE_BASE > description = "The latest adrem blogs" > > def items(self, obj): > return NewsItem.objects.order_by('-posted')[:20] > -- > class NewsItem(models.Model): > category = models.ForeignKey(NewsCategory) > show_in_all = models.BooleanField(default=False, > help_text="This only applies to the two original news categories (main > and dreamspace)") > posted = models.DateField() > headline = models.CharField(max_length=200) > story = models.TextField() > primary_picture = models.ImageField(upload_to="uploads/model/ > newsitem_pictures/", blank=True, null=True) > secondary_picture = models.ImageField(upload_to="uploads/model/ > newsitem_pictures/", blank=True, null=True) > > def get_absolute_url(self): > return urlresolvers.reverse("adremsite.adrem.views.news_item", > kwargs={"newsitem_id": self.id}) > > def __unicode__(self): > return "%s: %s" % (self.posted, self.headline) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: RSS producing wrong link from get_absolute url
Have you changed your `Site` model entry to the proper port number? On Fri, Apr 3, 2009 at 2:23 AM, John Bakerwrote: > > I have a strange problem with simple RSS feeds. It works fine locally > on my development machine but when I deploy to the test server running > through mod_python on port :81 the blog item links miss out the port > number and so don't work. > > Test server with new RSS code.. > http://www.adrem.uk.com:81/feeds/blog/ > > The links become (cutting out the port number!!!) > http://www.adrem.uk.com/blog/79/ > > Here are code snippets.. Help! Anyone got any ideas?? It is pretty > strange.. > -- > feeds = { > 'blog': BlogFeed, > 'jobs': JobsFeed, > } > -- > (r'^feeds/(?P.*)/$', 'django.contrib.syndication.views.feed', > {'feed_dict': feeds}), > (r'^blog/(?P\d+)/$', adrem.views.news_item), > -- > class BlogFeed(Feed): > title = "www.adrem.uk.com blog rss feed" > link = settings.SITE_BASE > description = "The latest adrem blogs" > > def items(self, obj): > return NewsItem.objects.order_by('-posted')[:20] > -- > class NewsItem(models.Model): > category = models.ForeignKey(NewsCategory) > show_in_all = models.BooleanField(default=False, > help_text="This only applies to the two original news categories (main > and dreamspace)") > posted = models.DateField() > headline = models.CharField(max_length=200) > story = models.TextField() > primary_picture = models.ImageField(upload_to="uploads/model/ > newsitem_pictures/", blank=True, null=True) > secondary_picture = models.ImageField(upload_to="uploads/model/ > newsitem_pictures/", blank=True, null=True) > > def get_absolute_url(self): > return urlresolvers.reverse("adremsite.adrem.views.news_item", > kwargs={"newsitem_id": self.id}) > > def __unicode__(self): > return "%s: %s" % (self.posted, self.headline) > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
RSS producing wrong link from get_absolute url
I have a strange problem with simple RSS feeds. It works fine locally on my development machine but when I deploy to the test server running through mod_python on port :81 the blog item links miss out the port number and so don't work. Test server with new RSS code.. http://www.adrem.uk.com:81/feeds/blog/ The links become (cutting out the port number!!!) http://www.adrem.uk.com/blog/79/ Here are code snippets.. Help! Anyone got any ideas?? It is pretty strange.. -- feeds = { 'blog': BlogFeed, 'jobs': JobsFeed, } -- (r'^feeds/(?P.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}), (r'^blog/(?P\d+)/$', adrem.views.news_item), -- class BlogFeed(Feed): title = "www.adrem.uk.com blog rss feed" link = settings.SITE_BASE description = "The latest adrem blogs" def items(self, obj): return NewsItem.objects.order_by('-posted')[:20] -- class NewsItem(models.Model): category = models.ForeignKey(NewsCategory) show_in_all = models.BooleanField(default=False, help_text="This only applies to the two original news categories (main and dreamspace)") posted= models.DateField() headline = models.CharField(max_length=200) story = models.TextField() primary_picture = models.ImageField(upload_to="uploads/model/ newsitem_pictures/", blank=True, null=True) secondary_picture = models.ImageField(upload_to="uploads/model/ newsitem_pictures/", blank=True, null=True) def get_absolute_url(self): return urlresolvers.reverse("adremsite.adrem.views.news_item", kwargs={"newsitem_id": self.id}) def __unicode__(self): return "%s: %s" % (self.posted, self.headline) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---