On Mon, Jan 11, 2010 at 05:58:07PM -0300, Gonzalo Delgado wrote:
> El 10/01/10 18:06, Wim De Hul escribió:
> > I'm trying to use Django in an embedded python app (main program is in C).
> > When I try to import the models from my Django app, I get the following
> > error:
> >
> > Traceback (most recent call last):
> > File "/data/mytest/test.py", line 4, in <module>
> > from accounts import models
> > File "/data/dj/accounts/models.py", line 1, in <module>
> > from django.db import models
> > File "/usr/lib/pymodules/python2.6/django/db/__init__.py", line 41, in
> > <module>
> > backend = load_backend(settings.DATABASE_ENGINE)
> > File "/usr/lib/pymodules/python2.6/django/db/__init__.py", line 22, in
> > load_backend
> > return import_module('.base', backend_name)
> > File "/usr/lib/pymodules/python2.6/django/utils/importlib.py", line 35,
> > in import_module
> > __import__(name)
> > ImportError: No module named mysql.base
> >
> > This is my sys.path:
> >
> > ['/data/mytest', '/data/dj', '/data/dj', '/usr/lib/python2.6',
> > '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk',
> > '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload',
> > '/usr/lib/python2.6/dist-packages', '/usr/lib/pymodules/python2.6',
> > '/usr/lib/pymodules/python2.6/gtk-2.0',
> > '/usr/local/lib/python2.6/dist-packages']
> >
> >
> > And this is the mysql module:
> > r...@lab:/data# ls -l /usr/lib/pymodules/python2.6/django/db/backends/mysql/
> > total 40
> > lrwxrwxrwx 1 root root 52 2009-12-27 15:12 base.py ->
> > /usr/share/pyshared/django/db/backends/mysql/base.py
> > -rw-r--r-- 1 root root 12169 2009-12-27 15:13 base.pyc
> > lrwxrwxrwx 1 root root 54 2009-12-27 15:12 client.py ->
> > /usr/share/pyshared/django/db/backends/mysql/client.py
> > -rw-r--r-- 1 root root 1581 2009-12-27 15:13 client.pyc
> > lrwxrwxrwx 1 root root 56 2009-12-27 15:12 creation.py ->
> > /usr/share/pyshared/django/db/backends/mysql/creation.py
> > -rw-r--r-- 1 root root 2939 2009-12-27 15:13 creation.pyc
> > -rw-r--r-- 1 root root 0 2009-12-27 15:13 __init__.py
> > -rw-r--r-- 1 root root 152 2009-12-27 15:13 __init__.pyc
> > lrwxrwxrwx 1 root root 61 2009-12-27 15:12 introspection.py ->
> > /usr/share/pyshared/django/db/backends/mysql/introspection.py
> > -rw-r--r-- 1 root root 4699 2009-12-27 15:13 introspection.pyc
> > lrwxrwxrwx 1 root root 58 2009-12-27 15:12 validation.py ->
> > /usr/share/pyshared/django/db/backends/mysql/validation.py
> > -rw-r--r-- 1 root root 1901 2009-12-27 15:13 validation.pyc
> > r...@lab:/data#
> >
> >
> > Everything seems OK for me... Django runs from Apache.
> > Someone has an idea?
> >
>
> MySQLdb[0] missing? The backend provided by Django depends on that.
>
> [0] http://sourceforge.net/projects/mysql-python/
>
Well, that would be the case if it didn't run with mod-apache, but it does.
Infact I found out that it is a Python problem.
It's also happening to the modules CVS and OpenSSL...
Strange...
> --
> Gonzalo Delgado <[email protected]>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
--
Wim
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.