1. Stefan Scherfke
  2. django-weblog

Commits

Stefan Scherfke  committed ac7bbdf

Use the sites framework to obtain the site’s title.

  • Participants
  • Parent commits 7049f11
  • Branches default

Comments (0)

Files changed (3)

File weblog/feeds.py

View file
 from django.conf import settings
 from django.core.exceptions import ObjectDoesNotExist
 from django.contrib.comments.models import Comment
+from django.contrib.sites.models import Site
 from django.contrib.syndication.feeds import Feed, FeedDoesNotExist
 from django.utils.feedgenerator import Atom1Feed
 
 class BaseFeed(Feed):
     
     feed_type = Atom1Feed
-    title = settings.SITE_INFO['title']
-    subtitle = settings.SITE_INFO['subtitle']
+    title = Site.objects.get_current().name
     title_template = 'feeds/post_title.html'
     description_template = 'feeds/post_description.html'
         

File weblog/templates/weblog/category_detail.html

View file
 {% load weblog_extras %}
 
 {% block title %}{{ block.super }} » Category » {{ category }}{% endblock %}
-{% block extra_headers %}<link rel="alternate" type="application/atom+xml" title="{{ site_info.title }} » Category » {{ category }}" href="/feeds/category/{{ category.path }}" />{% endblock %}
+{% block extra_head %}<link rel="alternate" type="application/atom+xml" title="{{ SITE.name }} » Category » {{ category }}" href="/feeds/category/{{ category.path }}" />{% endblock %}
 
 {% block content %}
 <div class="category">

File weblog/templates/weblog/post_detail.html

View file
 {% load markup %}
 
 {% block title %}{{ block.super }} » {{ post.title }}{% endblock %}
-{% block extra_headers %}<link rel="alternate" type="application/atom+xml" title="{{ site_info.title }} » Comments » {{ post }}" href="/feeds/comments/{{ post.year }}/{{ post.month }}/{{ post.day }}/{{ post.slug }}/" />{% endblock %}
+{% block extra_head %}<link rel="alternate" type="application/atom+xml" title="{{ SITE.name }} » Comments » {{ post }}" href="/feeds/comments/{{ post.year }}/{{ post.month }}/{{ post.day }}/{{ post.slug }}/" />{% endblock %}
 
 {% block content %}
 <div class="pagination-top">