Django/MySQL error - mysql

I have this error and I'm not sure how to fix it. I looked up some previous questions and some of them say it is because MySQL-python is not installed. However, I do have it installed
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 453, in execute_from_command_line
utility.execute()
File "/home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 272, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 77, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 8, in <module>
from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal
File "/home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/django/core/management/sql.py", line 9, in <module>
from django.db import models
File "/home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/django/db/__init__.py", line 40, in <module>
backend = load_backend(connection.settings_dict['ENGINE'])
File "/home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/django/db/__init__.py", line 34, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/django/db/utils.py", line 93, in __getitem__
backend = load_backend(db['ENGINE'])
File "/home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/django/db/utils.py", line 27, in load_backend
return import_module('.base', backend_name)
File "/home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 17, in <module>
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: /home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/_mysql.so: wrong ELF class: ELFCLASS32

try
sudo apt-get install python-mysqldb

Related

Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x10e2d62f0>

This is my first question. I'll try to get it right.
After having no problems running Django on my dev environment (on macOS 10.14.6) for over a year, I tried to start the server today and got this message:
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x10e2d62f0>
With this traceback:
Traceback (most recent call last):
File "/Users/mtd83/_Dev/env/lib/python3.4/site-packages/django/db/backends/mysql/base.py", line 25, in <module>
import MySQLdb as Database
File "/Users/mtd83/_Dev/env/lib/python3.4/site-packages/MySQLdb/__init__.py", line 19, in <module>
import _mysql
ImportError: dlopen(/Users/mtd83/_Dev/env/lib/python3.4/site-packages/_mysql.so, 2): Library not loaded: /usr/local/opt/mysql-connector-c/lib/libmysqlclient.18.dylib
Referenced from: /Users/mtd83/_Dev/env/lib/python3.4/site-packages/_mysql.so
Reason: image not found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/mtd83/_Dev/env/lib/python3.4/site-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/Users/mtd83/_Dev/env/lib/python3.4/site-packages/django/core/management/commands/runserver.py", line 113, in inner_run
autoreload.raise_last_exception()
File "/Users/mtd83/_Dev/env/lib/python3.4/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception
six.reraise(*_exception)
File "/Users/mtd83/_Dev/env/lib/python3.4/site-packages/django/utils/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/Users/mtd83/_Dev/env/lib/python3.4/site-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/Users/mtd83/_Dev/env/lib/python3.4/site-packages/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/mtd83/_Dev/env/lib/python3.4/site-packages/django/apps/registry.py", line 108, in populate
app_config.import_models(all_models)
File "/Users/mtd83/_Dev/env/lib/python3.4/site-packages/django/apps/config.py", line 199, in import_models
self.models_module = import_module(models_module_name)
File "/Users/mtd83/_Dev/env/lib/python3.4/importlib/__init__.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1129, in _exec
File "<frozen importlib._bootstrap>", line 1471, in exec_module
File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
File "/Users/mtd83/_Dev/env/lib/python3.4/site-packages/django/contrib/auth/models.py", line 4, in <module>
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
File "/Users/mtd83/_Dev/env/lib/python3.4/site-packages/django/contrib/auth/base_user.py", line 52, in <module>
class AbstractBaseUser(models.Model):
File "/Users/mtd83/_Dev/env/lib/python3.4/site-packages/django/db/models/base.py", line 119, in __new__
new_class.add_to_class('_meta', Options(meta, app_label))
File "/Users/mtd83/_Dev/env/lib/python3.4/site-packages/django/db/models/base.py", line 316, in add_to_class
value.contribute_to_class(cls, name)
File "/Users/mtd83/_Dev/env/lib/python3.4/site-packages/django/db/models/options.py", line 214, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
File "/Users/mtd83/_Dev/env/lib/python3.4/site-packages/django/db/__init__.py", line 33, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/Users/mtd83/_Dev/env/lib/python3.4/site-packages/django/db/utils.py", line 211, in __getitem__
backend = load_backend(db['ENGINE'])
File "/Users/mtd83/_Dev/env/lib/python3.4/site-packages/django/db/utils.py", line 115, in load_backend
return import_module('%s.base' % backend_name)
File "/Users/mtd83/_Dev/env/lib/python3.4/importlib/__init__.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/Users/mtd83/_Dev/env/lib/python3.4/site-packages/django/db/backends/mysql/base.py", line 28, in <module>
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: dlopen(/Users/mtd83/_Dev/env/lib/python3.4/site-packages/_mysql.so, 2): Library not loaded: /usr/local/opt/mysql-connector-c/lib/libmysqlclient.18.dylib
Referenced from: /Users/mtd83/_Dev/env/lib/python3.4/site-packages/_mysql.so
Reason: image not found
The problem probably has to do with some edits I made yesterday. I was trying to update Homebrew and I got a message that I had to change ownership and permissions to three files. Unfortunately I didn't take notes on what they were. It involed chown with the -R option.
Also, if it's any help, I've alway had to use sudo before manage.py runserver 80.
Sorry, I know this is pretty vague. Any help would be really appreciated.

Django - libssl.1.1.dylib library not loading error - Why is this occuring?

I am trying to migrate my changes in my existing Django project to mysql database using command python3 manage.py migrate. I transferred to a new MacBook with Catalina OS and installed everything from scatch. When I try to run the command I keep on getting this error trace stack:
The main cause of this error is this line: Library not loaded: libssl.1.1.dylib
Traceback (most recent call last):
File "/Users/vincegonzales/Documents/Anteriore/Project Apps/bonggakaday_api/venv/lib/python3.7/site-packages/django/db/backends/mysql/base.py", line 15, in <module>
import MySQLdb as Database
File "/Users/vincegonzales/Documents/Anteriore/Project Apps/bonggakaday_api/venv/lib/python3.7/site-packages/MySQLdb/__init__.py", line 18, in <module>
from . import _mysql
ImportError: dlopen(/Users/vincegonzales/Documents/Anteriore/Project Apps/bonggakaday_api/venv/lib/python3.7/site-packages/MySQLdb/_mysql.cpython-37m-darwin.so, 2): Library not loaded: libssl.1.1.dylib
Referenced from: /Users/vincegonzales/Documents/Anteriore/Project Apps/bonggakaday_api/venv/lib/python3.7/site-packages/MySQLdb/_mysql.cpython-37m-darwin.so
Reason: image not found
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "/Users/vincegonzales/Documents/Anteriore/Project Apps/bonggakaday_api/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/Users/vincegonzales/Documents/Anteriore/Project Apps/bonggakaday_api/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 357, in execute
django.setup()
File "/Users/vincegonzales/Documents/Anteriore/Project Apps/bonggakaday_api/venv/lib/python3.7/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/vincegonzales/Documents/Anteriore/Project Apps/bonggakaday_api/venv/lib/python3.7/site-packages/django/apps/registry.py", line 112, in populate
app_config.import_models()
File "/Users/vincegonzales/Documents/Anteriore/Project Apps/bonggakaday_api/venv/lib/python3.7/site-packages/django/apps/config.py", line 198, in import_models
self.models_module = import_module(models_module_name)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/Users/vincegonzales/Documents/Anteriore/Project Apps/bonggakaday_api/rest_api/models.py", line 3, in <module>
from django.contrib.auth.models import User
File "/Users/vincegonzales/Documents/Anteriore/Project Apps/bonggakaday_api/venv/lib/python3.7/site-packages/django/contrib/auth/models.py", line 2, in <module>
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
File "/Users/vincegonzales/Documents/Anteriore/Project Apps/bonggakaday_api/venv/lib/python3.7/site-packages/django/contrib/auth/base_user.py", line 47, in <module>
class AbstractBaseUser(models.Model):
File "/Users/vincegonzales/Documents/Anteriore/Project Apps/bonggakaday_api/venv/lib/python3.7/site-packages/django/db/models/base.py", line 101, in __new__
new_class.add_to_class('_meta', Options(meta, app_label))
File "/Users/vincegonzales/Documents/Anteriore/Project Apps/bonggakaday_api/venv/lib/python3.7/site-packages/django/db/models/base.py", line 305, in add_to_class
value.contribute_to_class(cls, name)
File "/Users/vincegonzales/Documents/Anteriore/Project Apps/bonggakaday_api/venv/lib/python3.7/site-packages/django/db/models/options.py", line 203, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
File "/Users/vincegonzales/Documents/Anteriore/Project Apps/bonggakaday_api/venv/lib/python3.7/site-packages/django/db/__init__.py", line 33, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/Users/vincegonzales/Documents/Anteriore/Project Apps/bonggakaday_api/venv/lib/python3.7/site-packages/django/db/utils.py", line 202, in __getitem__
backend = load_backend(db['ENGINE'])
File "/Users/vincegonzales/Documents/Anteriore/Project Apps/bonggakaday_api/venv/lib/python3.7/site-packages/django/db/utils.py", line 110, in load_backend
return import_module('%s.base' % backend_name)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/Users/vincegonzales/Documents/Anteriore/Project Apps/bonggakaday_api/venv/lib/python3.7/site-packages/django/db/backends/mysql/base.py", line 20, in <module>
) from err
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.
Did you install mysqlclient?

Readthedocs local installation fails

Installing readthedocs locally following the guidelines from the http://read-the-docs.readthedocs.io/en/latest/install.html fails. I'm attempting to install it on a Mac Pro OSX El Capitan 10.11.15.
When I try to reach localhosts:8000 it returns the message A server error occurred. Please contact the administrator.
The terminal outputs:
Performing system checks...
System check identified no issues (1 silenced).
July 21, 2016 - 15:04:28
Django version 1.8.3, using settings 'readthedocs.settings.dev'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/wsgiref/handlers.py", line 85, in run
self.result = application(self.environ, self.start_response)
File "/Users/Lex/rtd/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py", line 63, in __call__
return self.application(environ, start_response)
File "/Users/Lex/rtd/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 170, in __call__
self.load_middleware()
File "/Users/Lex/rtd/lib/python2.7/site-packages/django/core/handlers/base.py", line 52, in load_middleware
mw_instance = mw_class()
File "/Users/Lex/rtd/lib/python2.7/site-packages/django/middleware/locale.py", line 24, in __init__
for url_pattern in get_resolver(None).url_patterns:
File "/Users/Lex/rtd/lib/python2.7/site-packages/django/core/urlresolvers.py", line 402, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/Users/Lex/rtd/lib/python2.7/site-packages/django/core/urlresolvers.py", line 396, in urlconf_module
self._urlconf_module = import_module(self.urlconf_name)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/Users/Lex/rtd/checkouts/readthedocs.org/readthedocs/urls.py", line 54, in <module>
url(r'^api/v2/', include('readthedocs.restapi.urls')),
File "/Users/Lex/rtd/lib/python2.7/site-packages/django/conf/urls/__init__.py", line 33, in include
urlconf_module = import_module(urlconf_module)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/Users/Lex/rtd/checkouts/readthedocs.org/readthedocs/restapi/urls.py", line 10, in <module>
from readthedocs.comments.views import CommentViewSet
File "/Users/Lex/rtd/checkouts/readthedocs.org/readthedocs/comments/views.py", line 22, in <module>
from sphinx.websupport import WebSupport
File "/Users/Lex/rtd/lib/python2.7/site-packages/sphinx/websupport/__init__.py", line 18, in <module>
from docutils.core import publish_parts
File "/Users/Lex/rtd/lib/python2.7/site-packages/docutils/core.py", line 20, in <module>
from docutils import frontend, io, utils, readers, writers
File "/Users/Lex/rtd/lib/python2.7/site-packages/docutils/frontend.py", line 41, in <module>
import docutils.utils
File "/Users/Lex/rtd/lib/python2.7/site-packages/docutils/utils/__init__.py", line 20, in <module>
import docutils.io
File "/Users/Lex/rtd/lib/python2.7/site-packages/docutils/io.py", line 18, in <module>
from docutils.utils.error_reporting import locale_encoding, ErrorString, ErrorOutput
File "/Users/Lex/rtd/lib/python2.7/site-packages/docutils/utils/error_reporting.py", line 47, in <module>
locale_encoding = locale.getlocale()[1] or locale.getdefaultlocale()[1]
File "/Users/Lex/rtd/lib/python2.7/locale.py", line 562, in getlocale
return _parse_localename(localename)
File "/Users/Lex/rtd/lib/python2.7/locale.py", line 475, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8
[21/Jul/2016 15:04:37]"GET / HTTP/1.1" 500 59
Anyone familiar with this issue?
Fixed the issue by:
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"

My django can't runserver on mac

Hi all and thanks for taking time to help.
I am a front-end developer and newbie on the Django project.
I am trying to config a project on my Mac.
My colleague helped me to install the virtual environment but it an error still be there when I try to run the server of my project(Hobbit is the name of my project).
(env) ➜ Hobbit git:(feature/sell_system_main) ✗ python manage.py runserver
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Users/liao/workspace/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/Users/liao/workspace/env/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/liao/workspace/env/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/Users/liao/workspace/env/lib/python2.7/site-packages/django/core/management/base.py", line 280, in execute
translation.activate('en-us')
File "/Users/liao/workspace/env/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 130, in activate
return _trans.activate(language)
File "/Users/liao/workspace/env/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 188, in activate
_active.value = translation(language)
File "/Users/liao/workspace/env/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 177, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
File "/Users/liao/workspace/env/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 159, in _fetch
app = import_module(appname)
File "/Users/liao/workspace/env/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
__import__(name)
File "/Users/liao/workspace/env/lib/python2.7/site-packages/django/contrib/admin/__init__.py", line 6, in <module>
from django.contrib.admin.sites import AdminSite, site
File "/Users/liao/workspace/env/lib/python2.7/site-packages/django/contrib/admin/sites.py", line 4, in <module>
from django.contrib.admin.forms import AdminAuthenticationForm
File "/Users/liao/workspace/env/lib/python2.7/site-packages/django/contrib/admin/forms.py", line 6, in <module>
from django.contrib.auth.forms import AuthenticationForm
File "/Users/liao/workspace/env/lib/python2.7/site-packages/django/contrib/auth/forms.py", line 17, in <module>
from django.contrib.auth.models import User
File "/Users/liao/workspace/env/lib/python2.7/site-packages/django/contrib/auth/models.py", line 48, in <module>
class Permission(models.Model):
File "/Users/liao/workspace/env/lib/python2.7/site-packages/django/db/models/base.py", line 96, in __new__
new_class.add_to_class('_meta', Options(meta, **kwargs))
File "/Users/liao/workspace/env/lib/python2.7/site-packages/django/db/models/base.py", line 264, in add_to_class
value.contribute_to_class(cls, name)
File "/Users/liao/workspace/env/lib/python2.7/site-packages/django/db/models/options.py", line 124, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
File "/Users/liao/workspace/env/lib/python2.7/site-packages/django/db/__init__.py", line 34, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/Users/liao/workspace/env/lib/python2.7/site-packages/django/db/utils.py", line 198, in __getitem__
backend = load_backend(db['ENGINE'])
File "/Users/liao/workspace/env/lib/python2.7/site-packages/django/db/utils.py", line 113, in load_backend
return import_module('%s.base' % backend_name)
File "/Users/liao/workspace/env/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
__import__(name)
File "/Users/liao/workspace/env/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 17, in <module>
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: dlopen(/Users/liao/workspace/env/lib/python2.7/site-packages/_mysql.so, 2): Library not loaded: /usr/local/mysql/lib/libmysqlclient.18.dylib
Referenced from: /Users/liao/workspace/env/lib/python2.7/site-packages/_mysql.so
Reason: image not found
So I try to reinstall mysql by pip install mysql-python and result is
Requirement already satisfied (use --upgrade to upgrade): mysql-python in /Users/liao/workspace/env/lib/python2.7/site-packages
It seems that I have installed mysql in virtual environment.
Now I am confused what is the problem. Mysql or Django?

Python 3.3 no module named MySQLdb, cymysql installed

Working through the introductory Django project tutorial on the official site. I have successfully installed the CyMySQL 0.5.5 connector through pip. The server status is "Running". For the command python manage.py syncdb this is what powershell returns. Could this have something to do with the DATABASES section of settings.py file having wrong parameters? :
C:\Python33\lib\site-packages\win32\lib\pywintypes.py:39: DeprecationWarning: imp.get_suffixes() is deprecated; use
constants defined on importlib.machinery instead
for suffix_item in imp.get_suffixes():
Traceback (most recent call last):
File "C:\Python33\lib\site-packages\django\db\backends\mysql\base.py", line 14, in <module>
import MySQLdb as Database
ImportError: No module named 'MySQLdb'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:\Python33\lib\site-packages\django\core\management\__init__.py", line 399, in execute_from_command_line
utility.execute()
File "C:\Python33\lib\site-packages\django\core\management\__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python33\lib\site-packages\django\core\management\base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "C:\Python33\lib\site-packages\django\core\management\base.py", line 280, in execute
translation.activate('en-us')
File "C:\Python33\lib\site-packages\django\utils\translation\__init__.py", line 130, in activate
return _trans.activate(language)
File "C:\Python33\lib\site-packages\django\utils\translation\trans_real.py", line 188, in activate
_active.value = translation(language)
File "C:\Python33\lib\site-packages\django\utils\translation\trans_real.py", line 177, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
File "C:\Python33\lib\site-packages\django\utils\translation\trans_real.py", line 159, in _fetch
app = import_module(appname)
File "C:\Python33\Lib\importlib\__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 584, in _check_name_wrapper
File "<frozen importlib._bootstrap>", line 1022, in load_module
File "<frozen importlib._bootstrap>", line 1003, in load_module
File "<frozen importlib._bootstrap>", line 560, in module_for_loader_wrapper
File "<frozen importlib._bootstrap>", line 868, in _load_module
File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
File "C:\Python33\lib\site-packages\django\contrib\admin\__init__.py", line 6, in <module>
from django.contrib.admin.sites import AdminSite, site
File "C:\Python33\lib\site-packages\django\contrib\admin\sites.py", line 4, in <module>
from django.contrib.admin.forms import AdminAuthenticationForm
File "C:\Python33\lib\site-packages\django\contrib\admin\forms.py", line 6, in <module>
from django.contrib.auth.forms import AuthenticationForm
File "C:\Python33\lib\site-packages\django\contrib\auth\forms.py", line 17, in <module>
from django.contrib.auth.models import User
File "C:\Python33\lib\site-packages\django\contrib\auth\models.py", line 48, in <module>
class Permission(models.Model):
File "C:\Python33\lib\site-packages\django\db\models\base.py", line 96, in __new__
new_class.add_to_class('_meta', Options(meta, **kwargs))
File "C:\Python33\lib\site-packages\django\db\models\base.py", line 264, in add_to_class
value.contribute_to_class(cls, name)
File "C:\Python33\lib\site-packages\django\db\models\options.py", line 124, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
File "C:\Python33\lib\site-packages\django\db\__init__.py", line 34, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "C:\Python33\lib\site-packages\django\db\utils.py", line 198, in __getitem__
backend = load_backend(db['ENGINE'])
File "C:\Python33\lib\site-packages\django\db\utils.py", line 113, in load_backend
return import_module('%s.base' % backend_name)
File "C:\Python33\Lib\importlib\__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Python33\lib\site-packages\django\db\backends\mysql\base.py", line 17, in <module>
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named 'MySQLdb'
Please use django-cymysql and latest cymysql
djang-cymysql https://github.com/nakagami/django-cymysql/
cymysql 0.7.2 https://pypi.python.org/pypi/cymysql/0.7.2
and use 'mysql_cymysql' ENGINE