# -*- coding: utf-8 -*- import MySQLdb from MySQLdb.cursors import DictCursor from django.core.management.base import BaseCommand, CommandError from functions.translate import fill_with_signal from article.models import Article class Command(BaseCommand): def handle(self, *args, **options): db = MySQLdb.connect(host="localhost", user="kotzilla", passwd="qazedc", db="old_expomap", charset='utf8', cursorclass=DictCursor) cursor = db.cursor() sql = """SELECT articles_description.articles_id as id , articles_description.articles_name as name, articles_description.articles_description as description, articles_description.articles_head_title_tag as title, articles_description.articles_head_desc_tag as descriptions, articles_description.articles_head_keywords_tag as keywords, articles_description.articles_intro as main_title, articles.articles_date_added as created, articles.articles_last_modified as modified FROM `articles_description` JOIN articles ON articles_description.articles_id=articles.articles_id"""