I have recently been porting a Django site from python 2.7 to python 3.4 but I'm running into some problems with getting MySQL working...
First of all I'm using a virtualenv for all the python related files and I'm trying to get this to work with Django 1.7
First I had to make a few changes to the WSGI file to get it to work with python 3:
import os
import sys
activate_this = '/home/janis/.virtualenvs/footbagsite/bin/activate_this.py'
with open(activate_this) as f:
code = compile(f.read(), activate_this, 'exec')
exec(code, dict(__file__=activate_this))
## assuming your django settings file is at '/home/janis/dev-site/footbag_site/settings.py'
path = '/home/janis/footbagsite/dev-site/'
if path not in sys.path:
sys.path.append(path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'footbag_site.settings'
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
First I started with what was suggested at the documentation here: https://www.pythonanywhere.com/wiki/UsingMySQL I tried installing the mysql connector with:
pip3.4 install https://dev.mysql.com/get/Downloads/Connector-Python/mysql-connector-python-2.0.2.tar.gz
Along with the associated changes to the Django settings: 'ENGINE': 'mysql.connector.django',#backend from mysql
. However this didn't work as the mysql module was not being imported successfully, I would post the stacktrace but the error logging is no longer working for me.
I also tried using pip install mysqlclient
but had problems with this. I get a 500 server error but nothing appears in the logs for that error. From that point onwards I'm getting 500 server errors but nothing is appearing in the logs anymore. I'm not sure how to proceed from here, any advice would be appreciated.