pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: django/python missing sqlite



On Sat, Apr 11, 2009 at 12:23:29PM -0700, George Georgalis wrote:
> On Sat 11 Apr 2009 at 09:07:43 PM +0200, Joerg Sonnenberger wrote:
> >On Sat, Apr 11, 2009 at 11:55:24AM -0700, George Georgalis wrote:
> >> ( cd /usr/pkgsrc/www/py-django/ && bmake deinstall clean )
> >> ( cd /usr/pkgsrc/databases/py-sqlite2 && bmake deinstall clean )
> >> ( cd /usr/pkgsrc/databases/py-sqlite3 && bmake install )
> >> ( cd /usr/pkgsrc/www/py-django/ && bmake install PKG_OPTIONS.django=sqlite 
> >> )
> >> 
> >> but py-django still installs py-sqlite2:
> >
> >Yes, that is expected. The question is: does it work for you after you
> >installed py-sqlite3?
> 
> Doh! Success, I had stopped the py-django build when I saw it
> building py-sqlite2, but seems okay with the py-sqlite3 installed.
> Thanks!

OK, can you now deinstall py-sqlite3 again and apply the attached patch?

Joerg
$NetBSD$

--- db/backends/sqlite3/base.py.orig    2009-04-11 22:01:24.000000000 +0200
+++ db/backends/sqlite3/base.py
@@ -12,18 +12,11 @@ from django.db.backends.sqlite3.creation
 from django.db.backends.sqlite3.introspection import DatabaseIntrospection
 
 try:
-    try:
-        from sqlite3 import dbapi2 as Database
-    except ImportError, e1:
-        from pysqlite2 import dbapi2 as Database
+    from pysqlite2 import dbapi2 as Database
 except ImportError, exc:
     import sys
     from django.core.exceptions import ImproperlyConfigured
-    if sys.version_info < (2, 5, 0):
-        module = 'pysqlite2'
-    else:
-        module = 'sqlite3'
-        exc = e1
+    module = 'pysqlite2'
     raise ImproperlyConfigured, "Error loading %s module: %s" % (module, exc)
 
 try:


Home | Main Index | Thread Index | Old Index