Exemplo n.º 1
0
# Data Base libraries.
from pages.models import NavBar
from pages.models import ShogunPage
from pages.models import Article
from pages.models import New

# Import the parser.
import os
import os.path
import parserHTML
import datetime
import calendar
from BeautifulSoup import BeautifulSoup

# Parse news object.
newsParser = parserHTML.myContentHandler()


def error(err):
    if settings.DEBUG:
        print(err)
    raise Http404


def get_news():
    # Get the last 5 articles modified.
    news = New.objects.order_by('-updated_date')[:7]

    # Latest news
    latest = None
    if len(news) > 0: