1

I am following this video tutorial to learn Django: https://www.youtube.com/watch?v=F5mRW0jo-U4&t=909s

I am at the "Your first app component" section where he creates an app and then migrates it. I have followed every one of his steps so far yet I keep getting the no changes detected error when I migrate the app

I have tried researching ways to fix this but it doesn't seem like there is any one right way to do it, it's more of a case by case basis. I've made sure my app is under the install_apps section in the settings. I've tried python manage.py makemigrations but that tells me there are no changes detected. I've tried "python manage.py makemigrations product" to be more specific but it tells me that App 'product' could not be found. Is it in INSTALLED_APPS?" even though it is in installed apps

currently this is my installed apps section:

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'product',
Zahir Guess
  • 19
  • 1
  • 3
  • 2
    Please show the layout of your project files. In the video you linked to, the app name is `products` with an 's', so they would add `'products'` to `INSTALLED_APPS` and run `manage.py makemigrations products`. – Alasdair Apr 16 '19 at 21:34
  • @Alasdair I tried adding the 's' at the end but I got the same result. This is what is inside the products folder on my laptop: views.py tests.py models.py migrations apps.py admin.py __init__.py – Zahir Guess Apr 17 '19 at 21:21
  • If the folder name, `INSTALLED_APPS` and `makemigrations` command match, then it should work. You haven’t shown any code that would explain the issue you are seeing, so it’s difficult to help. Perhaps the migrations have already been created (run `manage.py showmigrations` to check). – Alasdair Apr 17 '19 at 21:53
  • @Alasdair I figured it out. The way I had my files organized there was something that wasn't where it should have been and that threw everything off. Once I put it in the proper place everything worked fine. Thank you for the assistance – Zahir Guess Apr 17 '19 at 22:52
  • This is a link to the same question with much more comprehensive coverage. Please try it if you want more guidance: https://stackoverflow.com/a/49427361/134044 – NeilG Jun 01 '22 at 08:27

3 Answers3

2

after migrate and makemigrations command put your app name like this

python manage.py migrate product
python manage.py makemigrations product

my case it's working

0

You didn't add your app name in 'Installed_Apps' in settings.py. Add this first and then run again.

Ahmed
  • 595
  • 4
  • 25
0

for a proper migrations with 'python manage.py makemigrations' make sure that after creating your model class you save them before you typing any console code very important