diff --git a/djangocms_blog/cms_menus.py b/djangocms_blog/cms_menus.py index 8e0e247..e28873e 100644 --- a/djangocms_blog/cms_menus.py +++ b/djangocms_blog/cms_menus.py @@ -3,7 +3,6 @@ from __future__ import absolute_import, print_function, unicode_literals from cms.apphook_pool import apphook_pool from cms.menu_bases import CMSAttachMenu -from django.contrib.sites.shortcuts import get_current_site from django.core.urlresolvers import resolve from django.db.models.signals import post_delete, post_save from django.utils.translation import get_language_from_request, ugettext_lazy as _ @@ -14,6 +13,11 @@ from .cms_appconfig import BlogConfig from .models import BlogCategory, Post from .settings import MENU_TYPE_CATEGORIES, MENU_TYPE_COMPLETE, MENU_TYPE_POSTS, get_setting +try: + from django.contrib.sites.shortcuts import get_current_site +except ImportError: + from django.contrib.sites.models import get_current_site + class BlogCategoryMenu(CMSAttachMenu): """ diff --git a/djangocms_blog/feeds.py b/djangocms_blog/feeds.py index 52f31e9..d27b573 100644 --- a/djangocms_blog/feeds.py +++ b/djangocms_blog/feeds.py @@ -19,15 +19,14 @@ from djangocms_blog.views import PostDetailView from .models import Post - try: import HTMLParser h = HTMLParser.HTMLParser() except ImportError: - import html.parser + from html.parser import HTMLParser - h = html.parser() + h = HTMLParser() class LatestEntriesFeed(Feed): @@ -46,7 +45,7 @@ class LatestEntriesFeed(Feed): return Site.objects.get_current().name def description(self): - return _('Blog articles on {site_name}').format(site_name=Site.objects.get_current().name) + return _('Blog articles on %(site_name)s') % {'site_name': Site.objects.get_current().name} def items(self, obj=None): return Post.objects.namespace( @@ -100,7 +99,7 @@ class FBInstantFeed(Rss201rev2Feed): handler.addQuickElement('link', self.feed['link']) handler.addQuickElement('description', self.feed['description']) if self.feed['language'] is not None: - handler.addQuickElement('language', 'it-it')#self.feed['language']) + handler.addQuickElement('language', 'it-it') for cat in self.feed['categories']: handler.addQuickElement('category', cat) if self.feed['feed_copyright'] is not None: