Code

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#4058 closed (fixed)

Databrowse AttributeError with USE_I18N=True

Reported by: anonymous Owned by: adrian
Component: Contrib apps Version: master
Severity: Keywords: databrowse
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Getting the error: "AttributeError: 'module' object has no attribute 'databrowse'" upon adding 'django.contrib.databrowse' to INSTALLED_APPS.

Attachments (0)

Change History (8)

comment:1 Changed 7 years ago by Nathan Borror <nathan@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Submitted by me :)

comment:2 Changed 7 years ago by adrian

Hmm, it works fine for me...

Could you paste the full traceback, please?

comment:3 Changed 7 years ago by anonymous

Traceback (most recent call last):
  File "./manage.py", line 11, in ?
    execute_manager(settings)
  File "/home/alex/source/svn/django/django/core/management.py", line 1669, in execute_manager
    execute_from_command_line(action_mapping, argv)
  File "/home/alex/source/svn/django/django/core/management.py", line 1561, in execute_from_command_line
    translation.activate('en-us')
  File "/home/alex/source/svn/django/django/utils/translation/__init__.py", line 66, in activate
    return real_activate(language)
  File "/home/alex/source/svn/django/django/utils/translation/__init__.py", line 41, in delayed_loader
    return g[caller](*args, **kwargs)
  File "/home/alex/source/svn/django/django/utils/translation/__init__.py", line 66, in activate
    return real_activate(language)
  File "/home/alex/source/svn/django/django/utils/translation/trans_real.py", line 194, in activate
    _active[currentThread()] = translation(language)
  File "/home/alex/source/svn/django/django/utils/translation/trans_real.py", line 183, in translation
    default_translation = _fetch(settings.LANGUAGE_CODE)
  File "/home/alex/source/svn/django/django/utils/translation/trans_real.py", line 166, in _fetch
    app = getattr(__import__(appname[:p], {}, {}, [appname[p+1:]]), appname[p+1:])
  File "/home/alex/source/svn/django/django/contrib/databrowse/__init__.py", line 1, in ?
    from django.contrib.databrowse.sites import DatabrowsePlugin, ModelDatabrowse, DatabrowseSite, site
  File "/home/alex/source/svn/django/django/contrib/databrowse/sites.py", line 3, in ?
    from django.contrib.databrowse.datastructures import EasyModel, EasyChoice
  File "/home/alex/source/svn/django/django/contrib/databrowse/datastructures.py", line 6, in ?
    from django.contrib.admin.views.main import EMPTY_CHANGELIST_VALUE
  File "/home/alex/source/svn/django/django/contrib/admin/views/main.py", line 4, in ?
    from django.contrib.admin.views.decorators import staff_member_required
  File "/home/alex/source/svn/django/django/contrib/admin/views/decorators.py", line 3, in ?
    from django.contrib.auth.models import User
  File "/home/alex/source/svn/django/django/contrib/auth/models.py", line 4, in ?
    from django.contrib.contenttypes.models import ContentType
  File "/home/alex/source/svn/django/django/contrib/contenttypes/models.py", line 33, in ?
    class ContentType(models.Model):
  File "/home/alex/source/svn/django/django/db/models/base.py", line 35, in __new__
    new_class.add_to_class('_meta', Options(attrs.pop('Meta', None)))
  File "/home/alex/source/svn/django/django/db/models/base.py", line 174, in add_to_class
    value.contribute_to_class(cls, name)
  File "/home/alex/source/svn/django/django/db/models/options.py", line 53, in contribute_to_class
    setattr(self, 'verbose_name_plural', meta_attrs.pop('verbose_name_plural', self.verbose_name + 's'))
  File "/home/alex/source/svn/django/django/utils/functional.py", line 42, in __wrapper__
    res = self.__func(*self.__args, **self.__kw)
  File "/home/alex/source/svn/django/django/utils/translation/__init__.py", line 52, in gettext
    return real_gettext(message)
  File "/home/alex/source/svn/django/django/utils/translation/trans_real.py", line 254, in gettext
    _default = translation(settings.LANGUAGE_CODE)
  File "/home/alex/source/svn/django/django/utils/translation/trans_real.py", line 183, in translation
    default_translation = _fetch(settings.LANGUAGE_CODE)
  File "/home/alex/source/svn/django/django/utils/translation/trans_real.py", line 166, in _fetch
    app = getattr(__import__(appname[:p], {}, {}, [appname[p+1:]]), appname[p+1:])
AttributeError: 'module' object has no attribute 'databrowse'

comment:4 Changed 7 years ago by Simon G. <dev@…>

  • Triage Stage changed from Unreviewed to Accepted

I get exactly the same traceback in trans_real when it trys to parse the models.py

(#4059 looks to be a duplicate of this too)

comment:5 Changed 7 years ago by adrian

  • Summary changed from Databrowse AttributeError to Databrowse AttributeError with USE_I18N=True

I've verified that the problem happens when USE_I18N=True. It doesn't happen for me if USE_I18N=False.

comment:6 Changed 7 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

(In [5015]) Fixed #4058 -- Fixed AttributeError in databrowse with USE_I18N=True

comment:7 Changed 7 years ago by bin

Great response time Adrian!

So this is the contrib you have hinted at in the past? I'm very curious.

Thanks.

comment:8 Changed 7 years ago by adrian

Yes, this is the one. :)

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.