1👍
✅
You need to first define a database connection to the existing database, which is a setting that described here.
As it is mentioned in the comment section, the tutorial assumes that you build the model first, then populate the database schema in your actual database. If you work the other way round, you need to populate the models by existing database schema. Use this command:
python manage.py inspectdb > models.py
It would create a models file for you by inspecting the existing database. You might/might not need to tweak the generated code depends on your need, but it’s always good to look at it and learn.
Source:stackexchange.com