I've just converted my sqlite database to a MySql database and now I can't get the application to function. There error log says
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module
When I try and install mysqlclient I get the message that
Requirement already satisfied: mysqlclient in /usr/local/lib/python3.10/site-packages (from mysql) (2.1.0)
I'm using a free version of pythonanywhere. Is it possible that MySql isn't included with this? I didn't see anything that said that. Also, I'm currently in the Tarpit, could that have something to do with it?
Here's the error log:
2023-04-08 13:11:20,321: Error running WSGI application
2023-04-08 13:11:20,322: django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.
2023-04-08 13:11:20,323: Did you install mysqlclient?
2023-04-08 13:11:20,323: File "/var/www/waynemelnick_pythonanywhere_com_wsgi.py", line 17, in <module>
2023-04-08 13:11:20,323: application = get_wsgi_application()
2023-04-08 13:11:20,323:
2023-04-08 13:11:20,323: File "/home/WayneMelnick/.virtualenvs/mysite-virtualenv/lib/python3.10/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
2023-04-08 13:11:20,323: django.setup(set_prefix=False)
2023-04-08 13:11:20,324:
2023-04-08 13:11:20,324: File "/home/WayneMelnick/.virtualenvs/mysite-virtualenv/lib/python3.10/site-packages/django/__init__.py", line 24, in setup
2023-04-08 13:11:20,324: apps.populate(settings.INSTALLED_APPS)
2023-04-08 13:11:20,324:
2023-04-08 13:11:20,324: File "/home/WayneMelnick/.virtualenvs/mysite-virtualenv/lib/python3.10/site-packages/django/apps/registry.py", line 116, in populate
2023-04-08 13:11:20,324: app_config.import_models()
2023-04-08 13:11:20,325:
2023-04-08 13:11:20,325: File "/home/WayneMelnick/.virtualenvs/mysite-virtualenv/lib/python3.10/site-packages/django/apps/config.py", line 269, in import_models
2023-04-08 13:11:20,325: self.models_module = import_module(models_module_name)
2023-04-08 13:11:20,325:
2023-04-08 13:11:20,325: File "/home/WayneMelnick/.virtualenvs/mysite-virtualenv/lib/python3.10/site-packages/django/contrib/auth/models.py", line 3, in <module>
2023-04-08 13:11:20,325: from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
2023-04-08 13:11:20,325:
2023-04-08 13:11:20,326: File "/home/WayneMelnick/.virtualenvs/mysite-virtualenv/lib/python3.10/site-packages/django/contrib/auth/base_user.py", line 49, in <module>
2023-04-08 13:11:20,326: class AbstractBaseUser(models.Model):
2023-04-08 13:11:20,326:
2023-04-08 13:11:20,326: File "/home/WayneMelnick/.virtualenvs/mysite-virtualenv/lib/python3.10/site-packages/django/db/models/base.py", line 141, in __new__
2023-04-08 13:11:20,326: new_class.add_to_class("_meta", Options(meta, app_label))
2023-04-08 13:11:20,326:
2023-04-08 13:11:20,326: File "/home/WayneMelnick/.virtualenvs/mysite-virtualenv/lib/python3.10/site-packages/django/db/models/base.py", line 369, in add_to_class
2023-04-08 13:11:20,326: value.contribute_to_class(cls, name)
2023-04-08 13:11:20,327:
2023-04-08 13:11:20,327: File "/home/WayneMelnick/.virtualenvs/mysite-virtualenv/lib/python3.10/site-packages/django/db/models/options.py", line 231, in contribute_to_class
2023-04-08 13:11:20,327: self.db_table, connection.ops.max_name_length()
2023-04-08 13:11:20,327:
2023-04-08 13:11:20,327: File "/home/WayneMelnick/.virtualenvs/mysite-virtualenv/lib/python3.10/site-packages/django/utils/connection.py", line 15, in __getattr__
2023-04-08 13:11:20,327: return getattr(self._connections[self._alias], item)
2023-04-08 13:11:20,327:
2023-04-08 13:11:20,327: File "/home/WayneMelnick/.virtualenvs/mysite-virtualenv/lib/python3.10/site-packages/django/utils/connection.py", line 62, in __getitem__
2023-04-08 13:11:20,327: conn = self.create_connection(alias)
2023-04-08 13:11:20,328:
2023-04-08 13:11:20,328: File "/home/WayneMelnick/.virtualenvs/mysite-virtualenv/lib/python3.10/site-packages/django/db/utils.py", line 193, in create_connection
2023-04-08 13:11:20,328: backend = load_backend(db["ENGINE"])
2023-04-08 13:11:20,328:
2023-04-08 13:11:20,328: File "/home/WayneMelnick/.virtualenvs/mysite-virtualenv/lib/python3.10/site-packages/django/db/utils.py", line 113, in load_backend
2023-04-08 13:11:20,328: return import_module("%s.base" % backend_name)
2023-04-08 13:11:20,328:
2023-04-08 13:11:20,328: File "/home/WayneMelnick/.virtualenvs/mysite-virtualenv/lib/python3.10/site-packages/django/db/backends/mysql/base.py", line 17, in <module>
2023-04-08 13:11:20,328: raise ImproperlyConfigured(
[edit by admin: formatting]