Basic django snafu from a noob

8 views
Skip to first unread message

Steve Chervitz Trutane

unread,
Mar 11, 2009, 5:50:41 PM3/11/09
to Django users
I believe I may have hosed my django installation while I was trying
to get up and running with Pinax. I'm working from the django trunk
(1.1alpha) on linux. Here's what happens now when I try to fire up a
new django project (a la the turorial):

$ django-admin.py startproject mysite
$ cd mysite
$ python manage.py runserver
Validating models...
Unhandled exception in thread started by <function inner_run at
0xb7aacf0c>
Traceback (most recent call last):
File "/home/teamhuma/tools/django-trunk/django/core/management/
commands/runserver.py", line 48, in inner_run
self.validate(display_num_errors=True)
File "/home/teamhuma/tools/django-trunk/django/core/management/
base.py", line 249, in validate
num_errors = get_validation_errors(s, app)
File "/home/teamhuma/tools/django-trunk/django/core/management/
validation.py", line 22, in get_validation_errors
from django.db import models, connection
File "/home/teamhuma/tools/django-trunk/django/db/__init__.py", line
53, in <module>
'TIME_ZONE': settings.TIME_ZONE,
File "/home/teamhuma/lib/python2.6/site-packages/django/db/backends/
dummy/base.py", line 45, in __init__
super(DatabaseWrapper, self).__init__(*args, **kwargs)
TypeError: object.__init__() takes no parameters

(hangs until ctrl-c)

Diagnosis? Suggestions? Thanks in advance.

Steve

Malcolm Tredinnick

unread,
Mar 11, 2009, 10:55:51 PM3/11/09
to django...@googlegroups.com

I believe you just updated to the latest subversion trunk and are
running MySQL and encountered a bug that was fixed in r10030. The error
is being reported from a piece of code that changed heavily yesterday
(literally, about 24 hours ago as I write this) and there were some
side-effects that were still being sorted out over the next few hours.

If that's not your situation, pleaes provide some details about database
backend, Django version, etc.

Regards,
Malcolm


Steve Chervitz Trutane

unread,
Mar 12, 2009, 4:05:40 AM3/12/09
to Django users

On Mar 11, 7:55 pm, Malcolm Tredinnick <malc...@pointy-stick.com>
wrote:
My error goes away when using the official Django release (1.0.2)
rather than the current trunk (r10032).

As for the backend, I have not altered the settings.py that django-
admin.py startproject created, so my DATABASE_ENGINE is not defined
when I get the error I reported above.

But I do run into a MySQL issue when I specify mysql as the db engine
and install mysql support for my python using `easy_install mysql-
python':

$ cd mysite
$ python manage.py runserver
Validating models...
Unhandled exception in thread started by <function inner_run at
0xb7a815a4>
Traceback (most recent call last):
File "/home/teamhuma/tools/django-official/django/core/management/
commands/runserver.py", line 48, in inner_run
self.validate(display_num_errors=True)
File "/home/teamhuma/tools/django-official/django/core/management/
base.py", line 246, in validate
num_errors = get_validation_errors(s, app)
File "/home/teamhuma/tools/django-official/django/core/management/
validation.py", line 22, in get_validation_errors
from django.db import models, connection
File "/home/teamhuma/tools/django-official/django/db/__init__.py",
line 16, in <module>
backend = __import__('%s%s.base' % (_import_path,
settings.DATABASE_ENGINE), {}, {}, [''])
File "/home/teamhuma/tools/django-official/django/db/backends/mysql/
base.py", line 13, in <module>
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
module: /lib/tls/libc.so.6: version `GLIBC_2.4' not found (required
by /home/teamhuma/.python-eggs/MySQL_python-1.2.3b1-py2.6-linux-
i686.egg-tmp/_mysql.so)


I can avoid this problem if I install MySQL-python-1.2.2 from the
distribution (gotten from http://sourceforge.net/project/showfiles.php?group_id=22307).

So I'm good to go for now, content to stick with django 1.0.x until
1.1 stabilizes. For the record, I was also able to get the Pinax basic
project running from the pinax trunk, deployed with fcgi at
http://pinax-basic.teamhuman.org

Steve

Malcolm Tredinnick

unread,
Mar 12, 2009, 4:21:43 AM3/12/09
to django...@googlegroups.com
On Thu, 2009-03-12 at 01:05 -0700, Steve Chervitz Trutane wrote:
[...]

> My error goes away when using the official Django release (1.0.2)
> rather than the current trunk (r10032).
>
> As for the backend, I have not altered the settings.py that django-
> admin.py startproject created, so my DATABASE_ENGINE is not defined
> when I get the error I reported above.

Ah, the "dummy" backend -- now I read more closely, I can see it
mentioned in the traceback. Okay, so that's another overlooked case, but
nobody really uses dummy anyway, so it's pretty harmless. I'll fix it,
though.

[...]


> raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
> django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
> module: /lib/tls/libc.so.6: version `GLIBC_2.4' not found (required
> by /home/teamhuma/.python-eggs/MySQL_python-1.2.3b1-py2.6-linux-
> i686.egg-tmp/_mysql.so)

That's an entirely unrelated problem, though (once again "easy_install"
screws somebody over. As Jacob mentions frequently, given the name of
that script, there are only two things it has to do well and it so often
fails to satisfy either advertised claim).

Given you've claimed to be a "noob" in the title, perhaps you should
stick to released versions for a bit (e.g. prefer your distro-supplied
MySQLdb package). There are going to be enough ways to raise errors
without trying to add complications. :-)

Regards,
Malcolm

Reply all
Reply to author
Forward
0 new messages