Welcome, Guest! Log In | Create Account

Quick setup osx

From brickit

Jump to: navigation, search

For a quick evaluation or for development purposes, you can install a minimalist BrickIt server directly on your local computer. In this case, you don't need to worry about setting up apache or configuring backups.

If you happen to sit in front of a Mac running OS X 10.4 or later, you can simply cut and paste the following commands into a terminal. This should get you up and running within about 10 minutes.

NOTE: OS X 10.4 is running an older version (3.1.3) of sqlite3 than 10.5 (3.4.0). If that is a problem install sqlite3 3.4.0 or later.

1. Install Django web framework

Note: Django is progressing fast. Brickit is currently tested against the daily-updated SVN version. The latest official release (for which there would be a debian package) will probably *not* work.

You'll want to open Terminal, and run the following:

cd /Library/Python/2.5/site-packages
sudo svn co http://code.djangoproject.com/svn/django/trunk/ django_src

sudo ln -s `pwd`/django_src/django .
sudo ln -s `pwd`/django_src/django/bin/django-admin.py /usr/local/bin

Note that, if that site-packages directory does not exist on your system, you can find yours by running

python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"

2. Install Brickit

If you do not yet have a folder for local python packages, create one now, and add it to your PYTHONPATH. If you use a shell other than bash (the default), modify the last line.

cd
mkdir py
export PYTHONPATH=~/py:$PYTHONPATH
echo "export PYTHONPATH=~/py:$PYTHONPATH" >> ~/.profile

Now fetch the current brickit version and link the brickit python module into your PYTHONPATH:

cd ~/py
svn co https://brickit.svn.sourceforge.net/svnroot/brickit/trunk brickitproject
ln -s ~/py/brickitproject/brickit

You're almost there! Modify the default brickit settings to use sqlite3, instead of postgresql:

cd ~/py/brickit
mate settings.py # or some other editor

Somewhere around line 21, you'll find the database settings. Change them as follows:

DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = 'parts' # Or path to database file if using sqlite3.
# DATABASE_USER = 'partsuser' # Not used with sqlite3.
# DATABASE_PASSWORD = 'brickit' # Not used with sqlite3.
# DATABASE_HOST = '' # Set to empty string for localhost.
# DATABASE_PORT = '' # Set to empty string for default.

Now, go back to your terminal, and run:

python manage.py syncdb
# Note: This will ask you for the name of an administration user -- I choose 'admin'.
python manage.py runserver localhost:8000

Fire up a browser, hit http://localhost:8000/parts or http://localhost:8000/admin, and you should be in business!

Spice things up with some example data:

~/py/brickitproject/brickit
python manage.py loaddata example_data.json