Dear all,
I've started using Django only a few months ago so I'm not an expert at all.
(But until now I could explain most of the problems what I had.. :))
Config: Raspbian, MySql, Django 1.6, Python 2.7.3 -- but most of the
versions are in the attached stacktrace file.
Symptom: every 5th page refresh is generating this cannot import name utils
error. Return page is of course a http 500 error.
How could I narrow this issue? Why is coming this error only sometimes?
Any ideas?
Many thanks!
BR,
Miklos
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/bca9a31d-a2d7-4d05-9cf2-c0aaaf223648%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Linux testpi 3.10.24+ #614 PREEMPT Thu Dec 19 20:38:42 GMT 2013 armv6l
[Sun Jan 19 06:25:18 2014] [error] python_init: Python version mismatch,
expected '2.7.2+', found '2.7.3'.
[Sun Jan 19 06:25:18 2014] [error] python_init: Python executable found
'/usr/bin/python'.
[Sun Jan 19 06:25:18 2014] [error] python_init: Python path being used
'/usr/lib/python2.7/:/usr/lib/python2.7/plat-linux2:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload'.
[Sun Jan 19 06:25:18 2014] [notice] mod_python: Creating 8 session mutexes
based on 150 max processes and 0 max threads.
[Sun Jan 19 06:25:18 2014] [notice] mod_python: using mutex_directory /tmp
[Sun Jan 19 06:25:18 2014] [warn] mod_wsgi: Compiled for Python/2.7.2+.
[Sun Jan 19 06:25:18 2014] [warn] mod_wsgi: Runtime using Python/2.7.3.
[Sun Jan 19 06:25:18 2014] [notice] Apache/2.2.22 (Debian) PHP/5.4.4-14+deb7u7
mod_python/3.3.1 Python/2.7.3 mod_wsgi/3.3 configured -- resuming normal
operations
[Sun Jan 19 06:49:47 2014] [error] [client 86.59.144.19] mod_wsgi (pid=9470):
Target WSGI script '/opt/homemonitor/homemonitor/wsgi.py' cannot be loaded as
Python module.
[Sun Jan 19 06:49:47 2014] [error] [client 86.59.144.19] mod_wsgi (pid=9470):
Exception occurred processing WSGI script
'/opt/homemonitor/homemonitor/wsgi.py'.
[Fri Jan 24 18:31:01 2014] [error] [client 86.59.144.19] File
"/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 40, in
import_module
[Fri Jan 24 18:31:01 2014] [error] [client 86.59.144.19] __import__(name)
[Fri Jan 24 18:31:01 2014] [error] [client 86.59.144.19] File
"/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line
39, in <module>
[Fri Jan 24 18:31:01 2014] [error] [client 86.59.144.19] from django.db
import utils
[Fri Jan 24 18:31:01 2014] [error] [client 86.59.144.19] ImproperlyConfigured:
Error importing module django.contrib.auth.middleware: "cannot import name
utils"
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] mod_wsgi (pid=9737):
Exception occurred processing WSGI script
'/opt/homemonitor/homemonitor/wsgi.py'.
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] Traceback (most recent
call last):
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] File
"/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line
187, in __call__
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19]
self.load_middleware()
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] File
"/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 47,
in load_middleware
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] mw_class =
import_by_path(middleware_path)
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] File
"/usr/local/lib/python2.7/dist-packages/django/utils/module_loading.py", line
26, in import_by_path
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] sys.exc_info()[2])
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] File
"/usr/local/lib/python2.7/dist-packages/django/utils/module_loading.py", line
21, in import_by_path
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] module =
import_module(module_path)
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] File
"/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 40, in
import_module
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] __import__(name)
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] File
"/usr/local/lib/python2.7/dist-packages/django/contrib/auth/middleware.py",
line 3, in <module>
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] from
django.contrib.auth.backends import RemoteUserBackend
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] File
"/usr/local/lib/python2.7/dist-packages/django/contrib/auth/backends.py", line
3, in <module>
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] from
django.contrib.auth.models import Permission
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] File
"/usr/local/lib/python2.7/dist-packages/django/contrib/auth/models.py", line
48, in <module>
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] class
Permission(models.Model):
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] File
"/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 96, in
__new__
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19]
new_class.add_to_class('_meta', Options(meta, **kwargs))
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] File
"/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 264, in
add_to_class
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19]
value.contribute_to_class(cls, name)
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] File
"/usr/local/lib/python2.7/dist-packages/django/db/models/options.py", line 124,
in contribute_to_class
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] self.db_table =
truncate_name(self.db_table, connection.ops.max_name_length())
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] File
"/usr/local/lib/python2.7/dist-packages/django/db/__init__.py", line 34, in
__getattr__
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] return
getattr(connections[DEFAULT_DB_ALIAS], item)
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] File
"/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 198, in
__getitem__
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] backend =
load_backend(db['ENGINE'])
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] File
"/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 113, in
load_backend
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] return
import_module('%s.base' % backend_name)
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] File
"/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 40, in
import_module
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] __import__(name)
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] File
"/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line
39, in <module>
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] from django.db
import utils
[Fri Jan 24 18:31:02 2014] [error] [client 86.59.144.19] ImproperlyConfigured:
Error importing module django.contrib.auth.middleware: "cannot import name
utils"