Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#11143 closed (duplicate)

AttributeError: 'str' object has no attribute '_default_manager'

Reported by: Camilo Nova Owned by: nobody
Component: Uncategorized Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Hi, since months ago i've getting sometimes this error:

Traceback (most recent call last):

 File "/home/axiacore/webapps/atlantis/lib/python2.5/django/core/handlers/", line 83, in get_response

 File "/home/axiacore/webapps/atlantis/lib/python2.5/django/core/", line 186, in resolve
   sub_match = pattern.resolve(new_path)

 File "/home/axiacore/webapps/atlantis/lib/python2.5/django/core/", line 184, in resolve
   for pattern in self.url_patterns:

 File "/home/axiacore/webapps/atlantis/lib/python2.5/django/core/", line 208, in _get_url_patterns
   patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)

 File "/home/axiacore/webapps/atlantis/lib/python2.5/django/core/", line 203, in _get_urlconf_module
   self._urlconf_module = import_module(self.urlconf_name)

 File "/home/axiacore/webapps/atlantis/lib/python2.5/django/utils/", line 35, in import_module

 File "/home/axiacore/webapps/atlantis/atlantis/local_apps/facturacion/", line 16, in <module>
   from atlantis.local_apps.facturacion.forms import PagoFacturaForm

 File "/home/axiacore/webapps/atlantis/atlantis/local_apps/facturacion/", line 5, in <module>
   class FacturaForm(forms.ModelForm):

 File "/home/axiacore/webapps/atlantis/lib/python2.5/django/forms/", line 201, in __new__
   opts.exclude, formfield_callback)

 File "/home/axiacore/webapps/atlantis/lib/python2.5/django/forms/", line 165, in fields_for_model
   formfield = formfield_callback(f)

 File "/home/axiacore/webapps/atlantis/lib/python2.5/django/forms/", line 183, in <lambda>
   lambda f: f.formfield())

 File "/home/axiacore/webapps/atlantis/lib/python2.5/django/db/models/fields/", line 727, in formfield

AttributeError: 'str' object has no attribute '_default_manager'

I get this only when i have DEBUG=False, when i have DEBUG=True it never happens. Also, it no only happen to that model, appears in any model, i get a feeling in how to reproduce it:

  1. Put your app in apache wsgi (i have it in webfaction)
  2. Try to enter a url who points to a view that have @login_required (Here the normal behavior is to redirect the user to login page, but sometimes, does not redirect, instead email me the error message*)
  3. When redirected to login page, you login, and then works as normally

Maybe its something when validating if the user is logged in for first time, but i dont have any idea, this is like the 20 error message that i get, so i consider it important.

Attachments (1)

error_log.txt (3.8 KB) - added by Camilo Nova 10 years ago.
Error log mailed to me

Download all attachments as: .zip

Change History (3)

Changed 10 years ago by Camilo Nova

Attachment: error_log.txt added

Error log mailed to me

comment:1 Changed 10 years ago by Karen Tracey

Resolution: duplicate
Status: newclosed

Looks like #10405. You should be able to fix it in your code by following the advice noted in this comment:

comment:2 Changed 10 years ago by Camilo Nova

Thanks, it works now.

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