Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'DatabaseWrapper' object has no attribute 'Database' #26

Open
yunmanger1 opened this issue Dec 8, 2013 · 3 comments
Open

'DatabaseWrapper' object has no attribute 'Database' #26

yunmanger1 opened this issue Dec 8, 2013 · 3 comments

Comments

@yunmanger1
Copy link

-e [email protected]:jschrewe/django-mongoadmin.git@5d4db8d1f51db19837250f2018cfca4d25fe77e7#egg=mongoadmin-master

Getting this error, when click on "add" link

Environment:


Request Method: GET
Request URL: http://localhost:8000/wfe/admin/home/wfspec/add/

Django Version: 1.6
Python Version: 2.7.4
Installed Applications:
('django.contrib.contenttypes',
 'django.contrib.auth',
 'mongoengine.django.mongo_auth',
 'django.contrib.sessions',
 'mongoadmin',
 'django.contrib.admin',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'djcelery',
 'home',
 'django_extensions',
 'mongoengine.django.mongo_auth',
 'django_ses',
 'djangular')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django_extensions.middlewares.ForceDefaultLanguageMiddleware')


Traceback:
File "/home/german/a/work/wfe/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  114.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/german/a/work/wfe/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in wrapper
  430.                 return self.admin_site.admin_view(view)(*args, **kwargs)
File "/home/german/a/work/wfe/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  99.                     response = view_func(request, *args, **kwargs)
File "/home/german/a/work/wfe/local/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  52.         response = view_func(request, *args, **kwargs)
File "/home/german/a/work/wfe/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
  198.             return view(request, *args, **kwargs)
File "/home/german/a/work/wfe/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapper
  29.             return bound_func(*args, **kwargs)
File "/home/german/a/work/wfe/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  99.                     response = view_func(request, *args, **kwargs)
File "/home/german/a/work/wfe/local/lib/python2.7/site-packages/django/utils/decorators.py" in bound_func
  25.                 return func(self, *args2, **kwargs2)
File "/home/german/a/work/wfe/local/lib/python2.7/site-packages/django/db/transaction.py" in inner
  338.             with self:
File "/home/german/a/work/wfe/local/lib/python2.7/site-packages/django/db/transaction.py" in __enter__
  237.             if not connection.get_autocommit():
File "/home/german/a/work/wfe/local/lib/python2.7/site-packages/django/db/backends/__init__.py" in get_autocommit
  324.         self.ensure_connection()
File "/home/german/a/work/wfe/local/lib/python2.7/site-packages/django/db/backends/__init__.py" in ensure_connection
  124.                 self.connect()
File "/home/german/a/work/wfe/local/lib/python2.7/site-packages/django/db/utils.py" in __exit__
  86.             db_exc_type = getattr(self.wrapper.Database, dj_exc_type.__name__)

Exception Type: AttributeError at /wfe/admin/home/wfspec/add/
Exception Value: 'DatabaseWrapper' object has no attribute 'Database'
@yunmanger1
Copy link
Author

How do you connect to mongodb? I am doing it this way

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.dummy'
    }
}
mongoengine.connnect(dbname)

@yunmanger1
Copy link
Author

Connecting to sqlite fixes the problem

@jschrewe
Copy link
Owner

Yeah, any relational db will fix it. It's still a bug though, because the idea is that it works without a relational db. Still need to figure out how to call a method without calling the decorator though.

@jschrewe jschrewe reopened this Dec 14, 2013
olivierlefloch pushed a commit to Work4Labs/django-mongoadmin that referenced this issue Mar 4, 2016
Fix inconsistent DocumentFormSet behavior
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants