I kept getting this error when trying to access the 'Post' model from the Python shell.
from blog.models import Post
Post.Status.choices
Traceback (most recent call last):
File "", line 1, in
AttributeError: type object 'Post' has no attribute 'Status'
After several failed attempts, I decided to run the 'python manage.py make migrations blog' command on terminal and it worked. I don't understand why the book instructs you to run the 'makemigrations' command afterwards (as shown on page 21).
I'm just a newbie so I don't quite understand what I could have possibly done wrong as I followed the instructions to the dot and double checked everything a million times. Luckily, I tried some other tutorials and they were making migrations to make the model take effect.
I would appreciate any clarifications, thank you 😊
I kept getting this error when trying to access the 'Post' model from the Python shell.
After several failed attempts, I decided to run the 'python manage.py make migrations blog' command on terminal and it worked. I don't understand why the book instructs you to run the 'makemigrations' command afterwards (as shown on page 21).
I'm just a newbie so I don't quite understand what I could have possibly done wrong as I followed the instructions to the dot and double checked everything a million times. Luckily, I tried some other tutorials and they were making migrations to make the model take effect.
I would appreciate any clarifications, thank you 😊