In this tutorial I will assume that you are using the Django module you created when you started the project (though it can be modified slightly if its a different module)
I will assume that myapp is that original module you created and model.py is where your ORM models are.
Ensure that you list myapp under INSTALLED_APPS list in settings.py. It is not there by default!
Ensure that on top of models.py you have the following import
from django.db import models
Also as part of step 2 you may need other imports to use some of the default tables that come with Django. For example, I always use the auth_user table which requires:
from django.contrib.auth.models import User
Table Generation (Made Easy?)
In settings.py ensure you have the following code snippet present since it is defaulted as false
migrated = True
Run the following in command line from the project’s directory. You may need sudo privileges. Remember to change myapp to your app’s name.
You may be required to specify myapp after makemigrations
You will have noticed that the above command would have made a directory migrations with file(s) in it.
The directory should have changed to look like this
– – 0001_initial.py
A file similar to the above will be generated, there is an option to name the file which can be found in the references.
Finally, run the following to have your tables generated in the database