A server error occurred. Please contact the administrator.
  • Why do I get this error after all successful setup??

    ravi-axon@ravi-axonsystem:/var/www/booktype/instance1$ sudo ./manage.py runserver 0.0.0.0:8005
    Validating models...

    0 errors found
    Django version 1.6.1, using settings 'instance1_site.settings.dev'
    Running django-devserver 0.8.0 (66a2cfc186d313708506e6926f757fc2c58fea98)
    Threaded Django server is running at http://0.0.0.0:8005/
    Quit the server with CONTROL-C.
    Traceback (most recent call last):
      File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
        self.result = application(self.environ, self.start_response)
      File "/usr/lib/python2.7/dist-packages/django/contrib/staticfiles/handlers.py", line 67, in __call__
        return self.application(environ, start_response)
      File "/usr/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 187, in __call__
        self.load_middleware()
      File "/usr/local/src/booktype/requirements/src/django-devserver/devserver/handlers.py", line 8, in load_middleware
        super(DevServerHandler, self).load_middleware()
      File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 45, in load_middleware
        mw_class = import_by_path(middleware_path)
      File "/usr/lib/python2.7/dist-packages/django/utils/module_loading.py", line 26, in import_by_path
        sys.exc_info()[2])
      File "/usr/lib/python2.7/dist-packages/django/utils/module_loading.py", line 21, in import_by_path
        module = import_module(module_path)
      File "/usr/lib/python2.7/dist-packages/django/utils/importlib.py", line 40, in import_module
        __import__(name)
      File "/usr/local/lib/python2.7/dist-packages/debug_toolbar/middleware.py", line 13, in <module>
        import debug_toolbar.urls
      File "/usr/local/lib/python2.7/dist-packages/debug_toolbar/urls.py", line 7, in <module>
        from django.conf.urls.defaults import *
    ImproperlyConfigured: Error importing module debug_toolbar.middleware: "No module named defaults"
    [10/Jun/2015 13:19:57] "GET / HTTP/1.1" 500 59 (time: 0.50s; sql: 3ms (3q))
    Traceback (most recent call last):
      File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
        self.result = application(self.environ, self.start_response)
      File "/usr/lib/python2.7/dist-packages/django/contrib/staticfiles/handlers.py", line 67, in __call__
        return self.application(environ, start_response)
      File "/usr/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 187, in __call__
        self.load_middleware()
      File "/usr/local/src/booktype/requirements/src/django-devserver/devserver/handlers.py", line 8, in load_middleware
        super(DevServerHandler, self).load_middleware()
      File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 45, in load_middleware
        mw_class = import_by_path(middleware_path)
      File "/usr/lib/python2.7/dist-packages/django/utils/module_loading.py", line 26, in import_by_path
        sys.exc_info()[2])
      File "/usr/lib/python2.7/dist-packages/django/utils/module_loading.py", line 21, in import_by_path
        module = import_module(module_path)
      File "/usr/lib/python2.7/dist-packages/django/utils/importlib.py", line 40, in import_module
        __import__(name)
      File "/usr/local/lib/python2.7/dist-packages/debug_toolbar/middleware.py", line 13, in <module>
        import debug_toolbar.urls
      File "/usr/local/lib/python2.7/dist-packages/debug_toolbar/urls.py", line 7, in <module>
        from django.conf.urls.defaults import *
    ImproperlyConfigured: Error importing module debug_toolbar.middleware: "No module named defaults"
    [10/Jun/2015 13:22:06] "GET / HTTP/1.1" 500 59 (time: 0.00s; sql: 0ms (0q))
  • 1 Comment sorted by
  • Hi Freeman!

    If you check the log file you will see you are using Django version 1.6.1. Booktype 2.0 and fixed version of django-toolbar library works with Django 1.5. API in Django 1.6 changed so I would say this is why you got the errors. Try to remove   line "INSTALLED_APPS += ('debug_toolbar',)" from dev.py settings file to so if it will work.


    We are testing newer version of Django with Booktype but these changes are not in the repository yet.

    Aco