Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#13512 closed (worksforme)

syncdb fails on application with no models defined

Reported by: Atr3ides Owned by: nobody
Component: Database layer (models, ORM) Version: 1.2-beta
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description (last modified by Karen Tracey)

Traceback (most recent call last):
  File "src/project/", line 18, in <module>
  File "/home/user/projects/project/ve/lib/python2.6/site-packages/django/core/management/", line 438, in execute_manager
  File "/home/user/projects/project/ve/lib/python2.6/site-packages/django/core/management/", line 379, in execute
  File "/home/user/projects/project/ve/lib/python2.6/site-packages/django/core/management/", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/user/projects/project/ve/lib/python2.6/site-packages/django/core/management/", line 217, in execute
  File "/home/user/projects/project/ve/lib/python2.6/site-packages/django/core/management/", line 245, in validate
    num_errors = get_validation_errors(s, app)
  File "/home/user/projects/project/ve/lib/python2.6/site-packages/django/core/management/", line 28, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/home/user/projects/project/ve/lib/python2.6/site-packages/django/db/models/", line 146, in get_app_errors
  File "/home/user/projects/project/ve/lib/python2.6/site-packages/django/db/models/", line 61, in _populate
    self.load_app(app_name, True)
  File "/home/user/projects/project/ve/lib/python2.6/site-packages/django/db/models/", line 78, in load_app
    models = import_module('.models', app_name)
  File "/home/user/projects/project/ve/lib/python2.6/site-packages/django/utils/", line 35, in import_module
  File "/home/user/projects/project/ve/lib/python2.6/site-packages/piston/", line 28, in <module>
  File "/home/user/projects/project/ve/lib/python2.6/site-packages/django/contrib/admin/", line 90, in register
    validate(admin_class, model)
  File "/home/user/projects/project/ve/lib/python2.6/site-packages/django/contrib/admin/", line 20, in validate
  File "/home/user/projects/project/ve/lib/python2.6/site-packages/django/db/models/", line 115, in get_apps
  File "/home/user/projects/project/ve/lib/python2.6/site-packages/django/db/models/", line 61, in _populate
    self.load_app(app_name, True)
  File "/home/user/projects/project/ve/lib/python2.6/site-packages/django/db/models/", line 83, in load_app
    if not module_has_submodule(app_module, 'models'):
  File "/home/user/projects/project/ve/lib/python2.6/site-packages/django/utils/", line 15, in module_has_submodule
    for entry in package.__path__:  # No __path__, then not a package.
AttributeError: 'module' object has no attribute '__path__'

Change History (3)

comment:1 Changed 8 years ago by Russell Keith-Magee

Resolution: worksforme
Status: newclosed

A stack trace doesn't constitute an error report. You need to tell us how to generate the error.

Working on the assumption that the problem is just 'an app without a', I can't reproduce this.

comment:2 Changed 8 years ago by Karen Tracey

Description: modified (diff)

Sounds like (though details of the traceback have changed in the interim): Prior to the introduction of module_has_submodule, things found in INSTALLED_APPS that did not have a __path__ were just ignored. The check was originally put in for "odd things" like eggs (though it's not necessary for eggs); the original person who hit a problem which caused the check to be added actually had a completely unnecessary non-app listed in INSTALLED_APPS. If there's a valid reason for having things in INSTALLED_APPS that don't have a __path__ then we can probably deal with it in module_has_submodule, but I haven't heard that reason yet. The one person who originally ran into the issue when the __path__ check was put in acknowledged it was caused by an error in their INSTALLED_APPS.

comment:3 Changed 7 years ago by Jacob

milestone: 1.2

Milestone 1.2 deleted

Note: See TracTickets for help on using tickets.
Back to Top