0. Problems
Since Django is rapidly developed, many tutorials about Django could be out-dated. I am learning Django and found that some commands have beed deprecated but the tutorial didn't update them.
So here I am taking notes for some of the deprecated commmands that I have encountered.
1. Can't use "python manage.py validate"
When learning the Django book, you might see this (if it's not updated):
python manage.py validate
It returns:
Unknown command: 'validate'
Type 'manage.py help' for usage.
Use this instead:
python manage.py check
2. Can't use "python manage.py sqlall" or "python manage.py syncdb"
python manage.py sqlall books
python manage.py syncdb
It returns:
Unknown command: 'sqlall'
Type 'manage.py help' for usage.
and
Unknown command: 'syncdb'
Type 'manage.py help' for usage.
Use this instead:
python manage.py makemigrations books
# Returns:
#Migrations for 'books':
# books/migrations/0001_initial.py:
# - Create model Author
# - Create model Book
# - Create model Publisher
# - Add field publisher to book
python manage.py migrate
# Returns:
# Operations to perform:
# Apply all migrations: admin, auth, books, contenttypes, sessions
# Running migrations:
# Applying books.0001_initial... OK
python manage.py sqlmigrate books 0001
# This will return the sql command executed on the mysql server