Django 1.8 migrations showing "AttributeError"

39 views
Skip to first unread message

vijay kumar

unread,
Jul 27, 2015, 11:15:48 PM7/27/15
to django...@googlegroups.com
Hi,
   Problem: Empty migration doesn't show user friendly message.
   
   When i run "python manage.py migrate" with no new migrations to be applied it show me error message "AttributeError: '_Meta' object has no attribute 'model_name'" instead of showing user friendly message "no migration to apply".
   I have using python3.4.1, django 1.8.3

Steps to replicate: First run migrate command to apply all migrations, Next re-run same command again.
     
 Below is trackback for reference.
Synchronizing apps without migrations:
  Creating tables...
    Running deferred SQL...
  Installing custom SQL...
Running migrations:
  No migrations to apply.

Traceback (most recent call last):
  File "manage.py", line 9, in <module>
    execute_from_command_line(sys.argv)
  File "/lib/python3.4/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/lib/python3.4/site-packages/django/core/management/__init__.py", line 330, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/python3.4/site-packages/django/core/management/base.py", line 393, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/lib/python3.4/site-packages/django/core/management/base.py", line 444, in execute
    output = self.handle(*args, **options)
  File "/lib/python3.4/site-packages/django/core/management/commands/migrate.py", line 207, in handle
    changes = autodetector.changes(graph=executor.loader.graph)
  File "//lib/python3.4/site-packages/django/db/migrations/autodetector.py", line 43, in changes
    changes = self._detect_changes(convert_apps, graph)
  File "/lib/python3.4/site-packages/django/db/migrations/autodetector.py", line 170, in _detect_changes
    old_field.rel.through._meta.model_name,
AttributeError: '_Meta' object has no attribute 'model_name'

Did anyone face similar issue?

Reply all
Reply to author
Forward
0 new messages