Recently I installed Python 3.4.3 in my environment (Windows 8.1) and tried to deploy a simple Django server. When I runned the command python manage.py runserver
but the following exceptions appeared:
Unhandled exception in thread started by .wrapper at 0x031B5D68>
I believe this exception happened due some error or misconception when I tried to install mysql-python
. I changed the DATABASE
config in settings.py
from "django.db.backends.mysql" to "django.db.backends.sqlite3" and runned pretty well. The configs that I tried are the following:
# Defective configuration
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'test',
'USER': 'user',
'PASSWORD': 'doideira',
'HOST': '127.0.0.1',
'PORT': '3306',
}
}
But using SQLite works:
# With SQLite 3 works
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
I am experiencing some troubles and any advice would be appreciated. I would like to know why this is happening and how can I workaround it.
Further info:
- Mysql version is 5.6.4
- Mysql Python version is 1.2.5
- Python version is 1.2.5
- Windows 8.1
- Django version is 1.8.1
The full log error can be seen here.
Update Saturday 16, May 2015:
I came up with an simple solution: downgrade Python from 3.x to 2.7.x. I explain the steps below as the answer of my question. I also found this answer very useful, but now that I'm using Python 2.7 everything is ok.
I also found this article that answers the question "Should I use Python 2 or Python 3 for my development activity" and that was what made me to decide whether keep with Python3 or Python2. Since Python3 hasn't a strong library support, I will wait a little more until update it.