Quick setup
From brickit
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 an Ubuntu or Debian Linux system, you can simply cut and paste the following commands into a terminal. This should get you up and running within about 10 minutes.
Contents |
1. Install sqlite
sudo apt-get install sqlite
2. install Django web framework
Note: Django is progressing fast. Brickit is currently tested against the daily-updated SVN version (before release 1.2). The latest official release (for which there would be a debian package) may not work.
sudo apt-get install python-psycopg2 cd /usr/lib/python2.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
3. install Brickit
If you are not yet having a folder for local python packages, create one now, and add it to your PYTHONPATH:
cd mkdir py cat echo "export PYTHONPATH=~/py:$PYTHONPATH" >> .zshenv
Note: If you use bash or another shell instead of zsh, you will need to adapt a different settings file (e.g. ".bashrc").
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
Adapt the brickit/settings.py file to use sqlite instead of postgresql:
DATABASE_ENGINE = 'sqlite3'
Create a folder for file attachments (adapt the MEDIA_ROOT variable in brickit/settings.py if you choose another location):
mkdir ~/staticdata
Create a new brickit database and fire up the development web server:
cd ~/py/brickitproject/brickit 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
4. Browse and play with Brickit
You can now access and modify the Brickit repository at http://localhost:8000
(login with the user name and password specified during the syncdb command above)
Load example data:
The brickit project contains a json file with example data. Load it with:
~/py/brickitproject/brickit python manage.py loaddata example_data.json
This will add several Biobricks, samples, and two additional users to your brickit site.
The passwords of all users are set to 'brickit'.
1. alternative: install PostgreSQL database
sudo apt-get install postgresql
Create database administrator, a user role "partsuser", and an empty database "parts"
sudo su postgres -c createuser admin ## add role "admin", answer 'y' to superuser question sudo su postgres -c createuser partsuser ## add role "partsuser", answer 'n' to superuser question createdb -U admin -O partsuser parts
Adapt database access control so that all users of the local machine can log in as admin but any access from outside is blocked -- replace the content of /etc/postgresql/8.2/main/pg_hba.conf with:
local all all trust host all 127.0.0.1 255.255.255.255 trust
Restart the database server.
sudo /etc/init.d/postgresql-8.2 restart
