V
V
vfvnvsyevsky2015-02-16 01:37:50
Django
vfvnvsyevsky, 2015-02-16 01:37:50

How to sync database in django?

In general:
1) created the article app through the terminal
2) created the article table in models
3) added the article to INSTALLED_APPS.
4) I enter python manage.py syncdb, the database file appears, but the article table is not there.
What is the problem?
0eed820308e845d79300ae3369265308.png
0d6c0296f61d4e9caa68b7e5ea8458c3.png
b493a22eba354263a065f90c561feb72.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladislav, 2015-02-16
@vfvnvsyevsky

Before running migrate (aka syncdb, but it's better to migrate, and forget about syncdb), you need to create migrations:

python manage.py makemigrations
python manage.py migrate

V
Vladimir Tatarnikov, 2015-02-16
@Termvsrobo

This is sync. Did you migrate? Try to do. This is how I solved a similar problem.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question