2
if you’re using Django 1.7, which I assume since you’re using makemigrations
then syncdb
is deprecated… you should be using migrate
https://docs.djangoproject.com/en/1.7/topics/migrations/#the-commands
see also:
https://docs.djangoproject.com/en/1.7/releases/1.7/#schema-migrations
0
When you make a fresh app with a fresh database, you run the commands in following order:
1) python manage.py syncdb
This creates all the tables that will be used by django (eg :auth_group, auth_user) etc.
You won’t see your app’s tables, after this command, in the database.
Then you do:
2) python manage.py makemigrations
This will run the initial migration and will detect all your new models.It just detects the models.Doesn’t create tables in the database
After that,run the following command
3) python manage.py migrate
This will create your tables.
After you have done this, you just need to use (2) and (3) for any changes to happen.The changes could be creating new models or editing the schema of existing models, etc.
So now, in your question, when you ran python manage.py makemigration
,it detected your new model “text”
Now just run python manage.py migrate
for the changes to take effect(in this case, to create table).
Hope this helps
- [Answered ]-When using Q objects in django queryset for OR condition error occured
- [Answered ]-Making Asynchronous Calls Using Twisted Inside a Django Project
- [Answered ]-Badly affecting performance in populating ManyToMany field values in rest api (using django rest framework)