Skip to content

Instantly share code, notes, and snippets.

@ianfieldhouse
Created October 5, 2012 10:01
Show Gist options
  • Save ianfieldhouse/3839037 to your computer and use it in GitHub Desktop.
Save ianfieldhouse/3839037 to your computer and use it in GitHub Desktop.
Setting up SQLite and Django project on virgin Solaris 10 container
SQLite on containers
====================
These instructions assume:
- you have Stow <http://www.gnu.org/software/stow/stow.html> installed in $HOME/local/stow
- that you are going to install all software in $HOME/local/stow/
- that you are going to use Stow to link you app installations into $HOME/local
- python virtual environments are created in $HOME/virtualenvs
- projects are deployed to $HOME/dist
- source code is downloaded and compiled in $HOME/src
Install readline
----------------
> cd $HOME/src/
> curl -O ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz
> tar -vxzf readline-6.2.tar.gz
> rm readline-6.2.tar.gz
> cd readline-6.2/
> ./configure --prefix=$HOME/local/stow/readline-6.2
> make
> make install
Link redline into $HOME/local with Stow
---------------------------------------
> cd $HOME/local/stow/
> stow -t $HOME/local readline-6.2
Install SQLite3
---------------
> cd $HOME/src/
> curl -O http://www.sqlite.org/sqlite-autoconf-3071401.tar.gz
> tar xvzf sqlite-autoconf-3071401.tar.gz
> rm sqlite-autoconf-3071401.tar.gz
> cd qlite-autoconf-3071401/
> CFLAGS="-I$HOME/local/include -DSQLITE_ENABLE_RTREE=1" ./configure --disable-dependency-tracking --enable-dynamic-extensions --enable-readline --enable-threadsafe --prefix=$HOME/local/stow/sqlite3
> make
> make install
Link sqlite3 into $HOME/local with Stow
---------------------------------------
> cd $HOME/local/stow/
> stow -t $HOME/local sqlite3
Optionally setup a Django project to use sqlite3
------------------------------------------------
> virtualenv --no-site-packages $HOME/virtualenvs/NEW_ENVIRONMENT_NAME
> . $HOME/virtualenvs/NEW_ENVIRONMENT_NAME/bin/activate
> pip install Django
> cd src
> curl -O http://pysqlite.googlecode.com/files/pysqlite-2.6.3.tar.gz
> tar -vxzf pysqlite-2.6.3.tar.gz
> rm pysqlite-2.6.3.tar.gz
> cd pysqlite-2.6.3/
> vim setup.cfg
change to:
#define=
include_dirs=$HOME/local/include
library_dirs=$HOME/local/lib
libraries=sqlite3
#define=SQLITE_OMIT_LOAD_EXTENSION
NOTE: Use the full path here. $HOME won't work as this is a python script not a bash script.
> python setup.py build
> python setup.py install
> cd $HOME/dist
> django-admin.py startproject NEW_PROJECT_NAME
Now you should just be able to edit the project setting.py file to use sqlite3 as the database.
Check everything is working ok by running the tests:
> python manage.py test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment