Skip to content
eyalev edited this page Oct 12, 2010 · 10 revisions
  1. git the code
  2. python bootstrap.py
  3. bin/buildout
  4. bin/django syncdb —migrate
  5. bin/django loaddata full_data.json
  6. bin/django runserver
  7. and you’re up and running

Ubuntu Dependencies

Before you can properly build the project you may want to install certain packages, by running the following:

sudo apt-get install python2.6-dev git-core django python-django \
python-django-doc python-psycopg2

This was tested on Ubuntu 9.10 Server (Karmic Koala)

Packages tested on Ubuntu 10.04:

python2.6-dev
python2.6
git-core
git-gui
git-doc
python-django
python-django-doc
python-psycopg2
python-setuptools
python-imaging

Switching from sqlite3 to postgres or mysql

Note that if you’ve tried the system with sqlite3 and you now want to move to a real database such as PostgreSQL, or perhaps to MySQL, you will need to do the following:

  1. Create a database (Character set: UTF8), and create a user + password for the database.
  2. Make sure the database is accessible with the above credentials and settings
  3. Modify the file src/knesset/settings.py to specify the database settings
  4. Perform steps 4 and 5 above

Sample Apache Site Configuration

Assumptions:

  • The site was extracted in your home directory
  • Your username and group are foo and bar respectively
  • You are using Ubuntu or Debian
  • We will create this configuration file in /etc/apache2/sites-available/oknesset

Here’s a sample file to get you started quickly with wsgi.

<VirtualHost *:80>
        ServerAdmin [email protected]
        ServerName mycoolserver.com
	#ServerAlias www.mycoolserver.com
	Alias /static /home/foo/Open-Knesset/static
	LogLevel warn
	WSGIScriptReloading on
	WSGIDaemonProcess tzafim.org processes=2 maximum-requests=500 threads=1 user=foo group=bar
	WSGIProcessGroup tzafim.org
	WSGIScriptAlias / /home/foo/Open-Knesset/deploy/knesset_wsgi.py
	<Directory /home/food/Open-Knesset/static>
		Order deny,allow
		Allow from all
	</Directory>
</VirtualHost>

Now enable the site and restart Apache:

a2ensite oknesset
service apache2 restart

You may now access http://mycoolserver.com and play around with the site

Upgrades from old code

If you’ve built this project several months ago, it’s safer to run the following:

rm -rf parts/ eggs/  bin/ downloads/ src/Open_Knesset.egg-info/ develop-eggs/ 

Don’t sudo-run this in yout root directory :-)

Those directories are not tracked (they’re in .gitignore), and erasing them before you checkout the files makes sure you get the latest versions of all eggs and parts.