{"id":4062,"date":"2019-03-29T13:34:51","date_gmt":"2019-03-29T08:04:51","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=4062"},"modified":"2019-04-05T14:21:35","modified_gmt":"2019-04-05T08:51:35","slug":"how-to-solve-django-migration-errors-core_module-issue","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/how-to-solve-django-migration-errors-core_module-issue\/","title":{"rendered":"How to solve Django migration errors-&#8220;core_module issue&#8221;"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">How to solve Django migration errors-&#8220;core_module issue&#8221;<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"mce_1\">Date posted : 29\/03\/2019<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">In this post, we&#8217;re gonna explain about the django migration related errors and how to solve it.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"604\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/python-plus-django-1-1024x604.jpg\" alt=\"\" class=\"wp-image-4064\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/python-plus-django-1-1024x604.jpg 1024w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/python-plus-django-1-300x177.jpg 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/python-plus-django-1-768x453.jpg 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/python-plus-django-1.jpg 1268w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Lets say you did add some new feature to your application and would like to roll out the changes to the production environment.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In python you need to do migrate the changes on prod while its running. If we didn&#8217;t complete the migration properly, we will see some errors like below.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Internal Server Error: \/admin\/core\/recept\/\nTraceback (most recent call last):\n  File \"\/usr\/local\/lib\/python3.6\/dist-packages\/django\/db\/backends\/utils.py\", line 85, in _execute\n    return self.cursor.execute(sql, params)\npsycopg2.ProgrammingError: relation \"core_recept\" does not exist\nLINE 1: SELECT COUNT(*) AS \"__count\" FROM \"core_recept\"\n<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1024\" height=\"343\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/Screen-Shot-2019-03-29-at-1.23.41-PM-1-1024x343.png\" alt=\"\" class=\"wp-image-4068\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/Screen-Shot-2019-03-29-at-1.23.41-PM-1-1024x343.png 1024w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/Screen-Shot-2019-03-29-at-1.23.41-PM-1-300x101.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/Screen-Shot-2019-03-29-at-1.23.41-PM-1-768x257.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/Screen-Shot-2019-03-29-at-1.23.41-PM-1.png 1396w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption>Core Module will miss in mysql\/postgresql<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">As the error stats that this is an issue with core module. We believe that the code migration didn&#8217;t applied completely. To resolve that we need to run below commands<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python3.6 manage.py makemigrations core\npython3.6 manage.py migrate core<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now login to your django admin panel and check. The errors should be gone.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"939\" height=\"554\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/Screen-Shot-2019-03-29-at-1.12.27-PM.png\" alt=\"\" class=\"wp-image-4065\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/Screen-Shot-2019-03-29-at-1.12.27-PM.png 939w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/Screen-Shot-2019-03-29-at-1.12.27-PM-300x177.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/03\/Screen-Shot-2019-03-29-at-1.12.27-PM-768x453.png 768w\" sizes=\"(max-width: 939px) 100vw, 939px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Thanks for using <a href=\"https:\/\/pheonixsolutions.com\">pheonix solutions<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You find this tutorial helpful? Share with your friends to keep it alive.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to solve Django migration errors-&#8220;core_module issue&#8221; Date posted : 29\/03\/2019 In this post, we&#8217;re gonna explain about the django [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1020],"tags":[602,292],"class_list":["post-4062","post","type-post","status-publish","format-standard","hentry","category-containers-kubernetes","tag-django","tag-python","psol-cat-containers-kubernetes"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-13w","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4062","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=4062"}],"version-history":[{"count":0,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4062\/revisions"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=4062"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=4062"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=4062"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}