Skip to content

OPMS Installation

sjlegg edited this page Aug 28, 2012 · 6 revisions

These instructions are for installing the OPMS from scratch on a Mac Mini, using the runserver command included with django's manage.py. If anything below doesn't work, you may need to install some things system-wide first.

  1. mkvirtualenv YourEnvironmentName to create a new virtual environment.
  2. workon YourEnvironmentName to start working on your new virtual environment.
  3. git clone git://github.com/ox-it/OPMS.git to download the OPMS code.
  4. cd OPMS
  5. pip install -r requirements.txt to install all the OPMS' vital requirements.
  6. pip install -r requirements_optional.txt to install other useful things.
  7. cd opms to enter the django project root
  8. cp local_settings.py.template local_settings.py to create a local_settings.py file with gaps in that will need to be filled in later.
  9. Now we need to create a database for django to use. Run pgstart to start the PostgreSQL server.
  10. To do this, we need to create an unique username/password combination for django to use. Type psql postgres to access the PostgreSQL prompt.
  11. Execute CREATE USER your_new_username WITH PASSWORD 'random_characters_here'; to create a new user.
  12. CREATE DATABASE your_database_name WITH OWNER your_new_username; to create a new database, owned by your new user.
  13. '\q' to exit psql.
  14. Open local_settings.py with your favourite text editor and make the appropriate bits of it look something like the following:

...

ADMINS = (

('choose_an_admin_username', 'Your Email'),

)

...

DATABASES = {

'default': {

'ENGINE': 'django.db.backends.postgresql_psycopg2',

'NAME': 'your_database_name',

'USER': 'your_new_username',

'PASSWORD': 'random_characters_here',

'HOST': '',

'PORT': '',

}

}

SECRET_KEY = 'random_string_of_characters_here'

...

  1. python manage.py syncdb to bring the database into line - type 'yes' when asked whether you would like to create a Django superuser, and then type choose_an_admin_username and Your Email when prompted. Also, choose a memorable, but secure, password.
  2. python manage.py migrate to create the sitetree tables.
  3. python manage.py loaddata core/fixtures/initial_sitetree.json to load the sitetree fixtures
  4. Edit settings.py to set WAIT_GET = True and YOUR_INSTITUTION = "Your Institution Name".
  5. Run python manage.py runserver to start the server. You should now be able to view http://localhost:8000/ in a web browser, logging in with the superuser username and password you created earlier.

Clone this wiki locally