def index(request, language = None): language = language or 'ru' try: metadata = Metadata.objects.get(location = 'main', language = language) except: metadata = None activate_language(request, language) return direct_to_template(request, template = 'index.html', extra_context = {'language': language, 'metadata': metadata})
def news_item(request, language = None, alias = None): language = language or 'ru' activate_language(request, language) object = get_object_or_404(NewsItem, alias = alias, language = language) return direct_to_template(request, template = 'page.html', extra_context = {'is_news': True, 'object': object, 'language': language})
def news(request, language = None): language = language or 'ru' activate_language(request, language) return direct_to_template(request, template = 'news.html', extra_context = {'is_news': True, 'language': language})