#24848 closed Bug (fixed)
makemigrations fails with 'ValueError: Dependency on unknown app' when migrations module exists without __init__.py
| Reported by: | Petros Moisiadis | Owned by: | Marten Kenbeek |
|---|---|---|---|
| Component: | Migrations | Version: | 1.8 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Django version 1.8.2
traceback:
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/path/to/python/env/lib/python3.4/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
utility.execute()
File "/path/to/python/env/lib/python3.4/site-packages/django/core/management/__init__.py", line 330, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/path/to/python/env/lib/python3.4/site-packages/django/core/management/base.py", line 390, in run_from_argv
self.execute(*args, **cmd_options)
File "/path/to/python/env/lib/python3.4/site-packages/django/core/management/base.py", line 441, in execute
output = self.handle(*args, **options)
File "/path/to/python/env/lib/python3.4/site-packages/django/core/management/commands/makemigrations.py", line 63, in handle
loader = MigrationLoader(None, ignore_no_migrations=True)
File "/path/to/python/env/lib/python3.4/site-packages/django/db/migrations/loader.py", line 47, in __init__
self.build_graph()
File "/path/to/python/env/lib/python3.4/site-packages/django/db/migrations/loader.py", line 287, in build_graph
parent = self.check_key(parent, key[0])
File "/path/to/python/env/lib/python3.4/site-packages/django/db/migrations/loader.py", line 165, in check_key
raise ValueError("Dependency on unknown app: %s" % key[0])
ValueError: Dependency on unknown app: users
Example project is included as an attachment.
Attachments (1)
Change History (5)
by , 10 years ago
| Attachment: | myproject.tar.gz added |
|---|
comment:1 by , 10 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
| Summary: | makemigrations fails with 'ValueError: Dependency on unknown app' when using custom user model → makemigrations fails with 'ValueError: Dependency on unknown app' when migrations module exists without __init__.py |
| Triage Stage: | Unreviewed → Accepted |
Note:
See TracTickets
for help on using tickets.
The problem is that, if you hit https://github.com/django/django/blob/master/django/db/migrations/loader.py#L81 due to a missing
__init__.pyfile, the app is neither inmigrated_appsnorunmigrated_apps. The same will happen if the migrations module is a file, and not a folder.