How to solve Django migration errors-“core_module issue”
How to solve Django migration errors-“core_module issue”
Date posted : 29/03/2019
In this post, we’re gonna explain about the django migration related errors and how to solve it.
Lets say you did add some new feature to your application and would like to roll out the changes to the production environment.
In python you need to do migrate the changes on prod while its running. If we didn’t complete the migration properly, we will see some errors like below.
Internal Server Error: /admin/core/recept/ Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/django/db/backends/utils.py", line 85, in _execute return self.cursor.execute(sql, params) psycopg2.ProgrammingError: relation "core_recept" does not exist LINE 1: SELECT COUNT(*) AS "__count" FROM "core_recept"
As the error stats that this is an issue with core module. We believe that the code migration didn’t applied completely. To resolve that we need to run below commands
python3.6 manage.py makemigrations core
python3.6 manage.py migrate core
Now login to your django admin panel and check. The errors should be gone.
Thanks for using pheonix solutions.
You find this tutorial helpful? Share with your friends to keep it alive.