Creating Table / BD with Django?

1

I use python 3.4 and the latest version of django, I am using the "python manage.py sqall" command but it does not recognize the sqall command. (I am trying to create a table in Bd, and already enter the data correctly.)

    
asked by anonymous 21.06.2018 / 19:12

1 answer

1

Daniel for your table to be created requires that your app be properly mapped inside your settings.py

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'exemplo'

]

For the migration to be done correctly the python manage.py makemigrations command is used to collect all the changes made in your project, finally call python manage.py migrate so that the changes are applied to the database. Home In this step, if your table does not exist, migrate will be in charge of creating it.

To better understand the subject of a read in the initial documentation. I quote here a fragment of the font to make it clear:

  

The migrate command checks the configuration in INSTALLED_APPS and creates any required database table according to the database settings in your mysite / settings.py file

    
21.06.2018 / 19:25