0

I have a website that loads/displays by grabbing the HTML from an SQLite3 database & displaying that (so if the user is on a Smart phone it will grab different HTML from the database than for someone on IE). I use python scripts as the server side behaviour to interact with the SQLite3 database & post the HTML.

My problem is: I am hosting the website with BlueHost & they only allow python 2.4 to run & the python SQLite3 module is a feature of Python 2.6 (or 2.7) & up. So my python scripts dont work when they run on BlueHost.

What do you think I can do to get my website to still use SQLite3 on the website? Are there any options for me? Maybe I can upload the Python module my fodler where my python scripts are?

PeeHaa
73.1k60 gold badges195 silver badges265 bronze badges
asked Jun 3, 2011 at 0:33

1 Answer 1

1

The sqlite3 module in python 2.5+ is based on the pysqlite package, which does work for python 2.4. You can instead install that package and swap the import, then you can use it with less work.

One option to support both methods is to use a conditional import, like this:

try:
 import sqlite3
except ImportError:
 from pysqlite import dbapi2 as sqlite3
answered Jun 3, 2011 at 0:38
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.