v/pol
1
0
mirror of https://github.com/taroved/pol synced 2025-05-17 06:40:08 -07:00

mysql connection to utf8

This commit is contained in:
Alexandr Nesterenko 2017-07-13 11:06:34 -07:00
parent acc4b6fd85
commit 64e66b9f83

View File

@ -13,7 +13,7 @@ from settings import DATABASES, DOWNLOADER_USER_AGENT
url_hash_regexp = re.compile('(#.*)?$') url_hash_regexp = re.compile('(#.*)?$')
POST_TIME_DISTANCE = 15 # minutes POST_TIME_DISTANCE = 15 # minutes, RSS Feed Reader skip same titles created in 10 min interval
FIELD_IDS = {'title': 1, 'description': 2, 'title_link': 3} FIELD_IDS = {'title': 1, 'description': 2, 'title_link': 3}
@ -161,6 +161,6 @@ def getFeedData(request, feed_id):
def get_conn(): def get_conn():
creds = DATABASES['default'] creds = DATABASES['default']
db = MySQLdb.connect(host=creds['HOST'], port=int(creds['PORT']), user=creds['USER'], passwd=creds['PASSWORD'], db=creds['NAME']) db = MySQLdb.connect(host=creds['HOST'], port=int(creds['PORT']), user=creds['USER'], passwd=creds['PASSWORD'], db=creds['NAME'], init_command='SET NAMES UTF8')
db.autocommit(True) db.autocommit(True)
return db return db