Installation¶
Python 2.7.5
We recommend the use of virtualenv <http://virtualenv.org> — Install it.
Create a virtual environment and activate it:
$ virtualenv ~/.python-envs/crowdata $ . ~/.python-envs/crowdata/bin/activate
Get the source code:
$ git clone https://github.com/crowdata/crowdata.git crowdata $ cd crowdata
Install dependencies:
$ pip install -r requirements.txt
(If you are using Ubuntu, you may need to install python-dev before dependencies.)
Create PostgreSQL database:
$ createuser -s -h localhost crow_user $ createdb -O crow_user -h localhost crowdata_development
Create extensions for doing trigram matching <http://www.postgresql.org/docs/9.2/static/pgtrgm.html> and removing accents <http://www.postgresql.org/docs/9.1/static/unaccent.html> in PostgreSQL:
$ psql -ucrow_user crow_user=# \c crowdata_development crowdata_development=# CREATE EXTENSION pg_trgm; crowdata_development=# CREATE EXTENSION unaccent;
Note: In Debian/Ubuntu you need to install postgresql-contrib-9.1 and geospatial libraries.
We keep local settings out of GIT. You will need to copy local_settings.py.example to local_settings.py. You will need to edit the database settings there.:
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'crowdata_development', # Or path to database file if using sqlite3. 'USER': 'crow_user', 'PASSWORD': '', 'HOST': '', 'PORT': '', } }
Initialize the database:
$ python manage.py syncdb $ python manage.py migrate --all
Start the development server:
$ python manage.py runserver_plus