...
This guide is written for Ubuntu 14.04.
Basic requirements
Start with installing some basic requirements and creating a new user as any superuser.
Code Block |
---|
$ sudo apt-get install python-setuptools git libpq-coredev python-dev $ sudo easy_install pip $ sudo pip install virtualenv $ sudo adduser openjdk-6-jdk build-essential postgresql python-psycopg2 libpq-dev python-dev disabled-password --home /var/opt/norduni ni # sudo apt-get install git-core python-virtualenv openjdk-6-jdk build-essential postgresql python-psycopg2 libpq-dev python-dev |
We are using postgresql but you can use any SQL database that Django supportsPostgresql is optional but you need a SQL database. See Django database documentation for other supported SQL databases.
Make a virtual python environment.
Code Block |
---|
sudo su
mkdir /opt/python_environments/
cd /opt/python_environments/
virtualenv --no-site-packages norduni
|
Making a virtual environment is also just a suggestion but it makes it easier to keep your system clean.
Install needed python modules.
Code Block |
---|
sudo su
source /opt/python_environments/norduni/bin/activate
pip install django ipaddr argparse pexpect markdown psycopg2 lucene-querybuilder django-tastypie xlwt south django-activity-stream django-jsonfield
|
Here psycopg2 is optional but you need to install the Python database module of your SQL database choice. If you have trouble installing psycopg2.
Get the NORDUni files:
Code Block |
---|
cd /opt/
git clone git://git.nordu.net/norduni.git
|
Get the NERDS files:
Code Block |
---|
mkdir /opt/norduni/tools/
cd /opt/norduni/tools/
git clone https://github.com/fredrikt/nerds.git
|
Symlink admin media and the virtual python environment to niweb.
Code Block |
---|
cd /opt/norduni/src/niweb/
ln -s /opt/python_environments/norduni env
cd static
ln -s ../env/lib/python2.6/site-packages/django/contrib/admin/media/ admin
|
Set password for database user and create a new database
...
Create database
Set password for database user and create a new database
Code Block |
---|
sudo -u postgres psql postgres
\password postgres
Write password
Write password again
Ctrl+D
sudo -u postgres createdb norduni
|
NORDUni repository
Get the NORDUni files.
Code Block |
---|
$ sudo -u ni -i
$ pwd
/var/opt/norduni
$ git clone git://git.nordu.net/norduni.git
|
Python environment
Make a virtual python environment.
Code Block |
---|
$ virtualenv norduni_environment
|
Making a virtual environment is also just a suggestion but it makes it easier to keep your system clean.
Python requirements
Install required python modules.
Code Block |
---|
$ . norduni_environment/bin/activate
$ pip install -r norduni/requirements.txt
|
Django settings
Change the django settings.
Code Block |
---|
# Django settings for niweb project
cd /opt/norduni/src/niweb/
cp generic_settings.py settings.py
vi settings.py
|
...
Code Block |
---|
NIWEB_ROOT = '/opt/norduni/src/niweb/' # Database settings DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'norduni', 'USER': 'postgres', 'PASSWORD': 'secret', 'HOST': 'localhost' } } # Neo4j settings NEO4J_RESOURCE_URI = '/opt/norduni/dependencies/neo4jdb/' |
Neo4j >1.5 embedded with Python bindings
...