S
S
Steve Smith @ Steve2015-06-28 10:46:44
Django
Steve Smith @ Steve, 2015-06-28 10:46:44

python manage.py migrate. Where is the mistake?

(studentsdb)[email protected]:~/data/work/virtualenvs/studentsdb/src/studentsdb$ python manage.py makemigrations students
Migrations for 'students':
  0001_initial.py:
    - Create model Student
(studentsdb)[email protected]:~/data/work/virtualenvs/studentsdb/src/studentsdb$ python manage.py migrate
Operations to perform:
  Apply all migrations: admin, students, contenttypes, auth, sessions
Running migrations:
  No migrations to apply.
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/leits/data/work/virtualenvs/studentsdb/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/home/leits/data/work/virtualenvs/studentsdb/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/leits/data/work/virtualenvs/studentsdb/local/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/leits/data/work/virtualenvs/studentsdb/local/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/home/leits/data/work/virtualenvs/studentsdb/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 164, in handle
    emit_post_migrate_signal(created_models, self.verbosity, self.interactive, connection.alias)
  File "/home/leits/data/work/virtualenvs/studentsdb/local/lib/python2.7/site-packages/django/core/management/sql.py", line 268, in emit_post_migrate_signal
    using=db)
  File "/home/leits/data/work/virtualenvs/studentsdb/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 198, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/home/leits/data/work/virtualenvs/studentsdb/local/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py", line 83, in create_permissions
    ctype = ContentType.objects.db_manager(using).get_for_model(klass)
  File "/home/leits/data/work/virtualenvs/studentsdb/local/lib/python2.7/site-packages/django/contrib/contenttypes/models.py", line 58, in get_for_model
    " is migrated before trying to migrate apps individually."
RuntimeError: Error creating new content types. Please make sure contenttypes is migrated before trying to migrate apps individually.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Steve_Smith, 2015-06-29
Smith

I decided. Deleted and recreated db.sqlite3.

R
Roman Kitaev, 2015-06-28
@deliro

You have not created migrations for other applications. Remove from
python manage.py makemigrations studentsstudents.

Z
zelsky, 2015-06-28
@zelsky

So-so book with him. + Contact them in the "get-together bought a book" there they will help.

S
sim3x, 2015-06-28
@sim3x

Error creating new content types. Please make sure contenttypes is migrated before trying to migrate apps individually.

try like this
python manage.py migrate contenttypes
python manage.py makemigrations
python manage.py migrate

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question