Django and darwinports

I was pounding away at the basics of Django tonight, and got myself terribly confused when I ran into a new error when attempting to set up the basic django databases (using django-admin.py init). It had worked previously, but tonight I received the error:


Error: The database couldn't be initialized.
You can only execute one statement at a time.

WTF? I thought at first that maybe it was because I was using the raw development branch of Django. After bothering the folks on the irc channel #django, that led me to trying out the code in the python interpreter. It just didn’t make sense. After a few minutes, I resorted back to the Django release (0.91) and ran with that – still got the error.

Now my hackles were up. I started digging around in my prerequisites, and eventually figured out that one of the times that I had updated bits from DarwinPorts, I updated sqlite3 to 3.3.3. I still had version 3.2.7 around, so I dropped back to it. Viola! Everything worked!

After further digging, I realized that DarwinPorts doesn’t make it easy to install older versions of sqlite3… so I took a look at the other component – py-sqlite. It turns out that the port is just slightly outdated – it’s still referencing the 2.0.x branch, and they’re up to 2.1.3 now. After a little more “sudo port …” invocations, I had sqlite 3.3.3 back in place, and py-sqlite 2.1.3 and everything was working great.

I fiddled for a bit making a new Portfile for py-sqlite, but something in the testing and prefix setup of the whole thing knocked me sideways. I fired off what I thought should be about right for the updated Portfile to the maintainer and asked for help – hopefully I hear something in the next few days. In the meantime, I’ll run from source that I manually installed – although I’d prefer to stick with the DarwinPorts setup. I probably just borked something making the new Portfile, or setting up to test it. I am NOT a port wizard, that’s for sure.

Hopefully if some other poor soul runs across this problem (until we get the Portfile updated) maybe Google will help provide an answer.

Published by heckj

Joe has broad software engineering development and management experience, from startups to large companies. Joe works on projects ranging from mobile to multi-cloud distributed systems, has set up and led engineering teams and processes, as well as managing and running services. Joe also contributes and collaborates with a wide variety of open source projects, and writes online at https://rhonabwy.com/.

%d bloggers like this: