Forums

django.db.utils.ProgrammingError: (1146, "Table 'XXXXXXXXXXXX' doesn't exist")

I have received a django project folder to continue the outstanding development in my local machine. I created my virtual env and installed the requirements.txt file. Also, made the localsettings.py file to connect to mySQL DB. On running the manage.py runserver / migrate commands i get the error: django.db.utils.ProgrammingError: (1146, "Table 'reccy_test.locations_country' doesn't exist"). Tried to migrate by "python manage.py migrate admin zero --fake" & "python manage.py migrate admin zero" but error remains the same. the total log is attached if anyone can help me locate the problem. File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\db\backends\utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\db\backends\mysql\base.py", line 71, in execute return self.cursor.execute(query, args) File "C:\Users\Siddhartha\reccypython\lib\site-packages\MySQLdb\cursors.py", line 209, in execute res = self._query(query) File "C:\Users\Siddhartha\reccypython\lib\site-packages\MySQLdb\cursors.py", line 315, in _query db.query(q) File "C:\Users\Siddhartha\reccypython\lib\site-packages\MySQLdb\connections.py", line 231, in query _mysql.connection.query(self, query) MySQLdb._exceptions.ProgrammingError: (1146, "Table 'reccy_test.locations_country' doesn't exist")

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "manage.py", line 21, in <module> main() File "manage.py", line 17, in main execute_from_command_line(sys.argv) File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\core\management__init__.py", line 381, in execute_from_command_line utility.execute() File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\core\management__init__.py", line 375, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\core\management\base.py", line 323, in run_from_argv self.execute(args, cmd_options) File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\core\management\base.py", line 361, in execute self.check() File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\core\management\base.py", line 390, in check include_deployment_checks=include_deployment_checks, File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\core\management\commands\migrate.py", line 65, in _run_checks issues.extend(super()._run_checks(kwargs)) File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\core\management\base.py", line 377, in _run_checks return checks.run_checks(*kwargs) File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\core\checks\registry.py", line 72, in run_checks new_errors = check(app_configs=app_configs) File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\core\checks\urls.py", line 40, in check_url_namespaces_unique all_namespaces = _load_all_namespaces(resolver) File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\core\checks\urls.py", line 57, in _load_all_namespaces url_patterns = getattr(resolver, 'url_patterns', []) File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\utils\functional.py", line 80, in get res = instance.dict[self.name] = self.func(instance) File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\urls\resolvers.py", line 584, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\utils\functional.py", line 80, in get res = instance.dict[self.name] = self.func(instance) File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\urls\resolvers.py", line 577, in urlconf_module return import_module(self.urlconf_name) File "c:\users\siddhartha\anaconda3\lib\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 "C:\Sid_WorkStation_10022020\RAPL\WebDevelopmentInhouse\reccy-master\reccy-master\reccy\reccy\urls.py", line 35, in <module> path('profile/', include(('users.urls','users'),namespace='users')), File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\urls\conf.py", line 34, in include urlconf_module = import_module(urlconf_module) File "c:\users\siddhartha\anaconda3\lib\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 "C:\Sid_WorkStation_10022020\RAPL\WebDevelopmentInhouse\reccy-master\reccy-master\reccy\users\urls.py", line 2, in <module> from .views import MyAccount File "C:\Sid_WorkStation_10022020\RAPL\WebDevelopmentInhouse\reccy-master\reccy-master\reccy\users\views.py", line 2, in <module> from .forms import UserForm, PasswordResetForm, UserWorkEmailForm File "C:\Sid_WorkStation_10022020\RAPL\WebDevelopmentInhouse\reccy-master\reccy-master\reccy\users\forms.py", line 7, in <module> class UserForm(forms.Form): File "C:\Sid_WorkStation_10022020\RAPL\WebDevelopmentInhouse\reccy-master\reccy-master\reccy\users\forms.py", line 8, in UserForm LOCATION_CHOICES = [(None,"-----")]+[(country.name, country.name) for country in Country.objects.all()] File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\db\models\query.py", line 274, in iter self._fetch_all() File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\db\models\query.py", line 1242, in _fetch_all self._result_cache = list(self._iterable_class(self)) File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\db\models\query.py", line 55, in iter results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size) File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\db\models\sql\compiler.py", line 1100, in execute_sql cursor.execute(sql, params) File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\db\backends\utils.py", line 99, in execute return super().execute(sql, params) File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\db\backends\utils.py", line 67, in execute return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\db\backends\utils.py", line 76, in _execute_with_wrappers return executor(sql, params, many, context) File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\db\backends\utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\db\utils.py", line 89, in exit raise dj_exc_value.with_traceback(traceback) from exc_value File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\db\backends\utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "C:\Users\Siddhartha\reccypython\lib\site-packages\django\db\backends\mysql\base.py", line 71, in execute return self.cursor.execute(query, args) File "C:\Users\Siddhartha\reccypython\lib\site-packages\MySQLdb\cursors.py", line 209, in execute res = self._query(query) File "C:\Users\Siddhartha\reccypython\lib\site-packages\MySQLdb\cursors.py", line 315, in _query db.query(q) File "C:\Users\Siddhartha\reccypython\lib\site-packages\MySQLdb\connections.py", line 231, in query _mysql.connection.query(self, query) django.db.utils.ProgrammingError: (1146, "Table 'reccy_test.locations_country' doesn't exist")

It's the code running on your local computer, not PythonAnywhere.

tell the answer

What is the question?