﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
21868	Empty migrations dir causes exception	lhn@…	Andrew Godwin <andrew@…>	"{{{
]$ python manage.py migrate
Operations to perform:
  Synchronize unmigrated apps: admin, auth, contenttypes, sessions
  Apply all migrations: (none)
Synchronizing apps without migrations:
  Creating tables...
  Installing custom SQL...
  Installing indexes...
Installed 0 object(s) from 0 fixture(s)
Running migrations:
  No migrations needed.
Traceback (most recent call last):
  File ""manage.py"", line 10, in <module>
    execute_from_command_line(sys.argv)
  File ""/usr/lib/python3.3/site-packages/Django-1.7a1-py3.3.egg/django/core/management/__init__.py"", line 427, in execute_from_command_line
    utility.execute()
  File ""/usr/lib/python3.3/site-packages/Django-1.7a1-py3.3.egg/django/core/management/__init__.py"", line 419, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File ""/usr/lib/python3.3/site-packages/Django-1.7a1-py3.3.egg/django/core/management/base.py"", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File ""/usr/lib/python3.3/site-packages/Django-1.7a1-py3.3.egg/django/core/management/base.py"", line 337, in execute
    output = self.handle(*args, **options)
  File ""/usr/lib/python3.3/site-packages/Django-1.7a1-py3.3.egg/django/core/management/commands/migrate.py"", line 140, in handle
    changes = autodetector.changes(graph=executor.loader.graph)
  File ""/usr/lib/python3.3/site-packages/Django-1.7a1-py3.3.egg/django/db/migrations/autodetector.py"", line 34, in changes
    changes = self._arrange_for_graph(changes, graph)
  File ""/usr/lib/python3.3/site-packages/Django-1.7a1-py3.3.egg/django/db/migrations/autodetector.py"", line 312, in _arrange_for_graph
    if app_leaf is None and not self.questioner.ask_initial(app_label):
  File ""/usr/lib/python3.3/site-packages/Django-1.7a1-py3.3.egg/django/db/migrations/questioner.py"", line 42, in ask_initial
    filenames = os.listdir(os.path.dirname(migrations_module.__file__))
AttributeError: 'module' object has no attribute '__file__'
}}}

Note: I'm using python3, not tested on python2

After deleting db.sqlite3 and all files in wishes/migrations and got the error above, when running migrate.
Deleting the same, plus the migrations directory solved the problem."	Bug	closed	Migrations	dev	Normal	fixed		info@…	Accepted	0	0	0	0	0	0
