-
Notifications
You must be signed in to change notification settings - Fork 1
OPMS Installation
marshalc edited this page Aug 31, 2012
·
6 revisions
These instructions are for installing the OPMS from scratch for a setup using a virtual environment, and 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.
-
mkvirtualenv YourEnvironmentNameto create a new virtual environment. -
workon YourEnvironmentNameto start working on your new virtual environment (and enter the related directory) -
git clone git://github.com/ox-it/OPMS.gitto download the OPMS code. cd OPMS-
pip install -r requirements.txtto install all the OPMS' vital requirements. -
pip install -r requirements_optional.txtto install other useful things for non-production environments. -
cd opmsto enter the django project root -
cp local_settings.py.template local_settings.pyto create a local_settings.py file with gaps in that will need to be filled in later. - Now we need to create a database for django to use. For example, run
pgstartto start the PostgreSQL server on your local Mac OS X install. - To do this, we need to create an unique username/password combination for django to use. Type
psql postgresto access the PostgreSQL prompt. - Execute
CREATE USER your_new_username WITH PASSWORD 'random_characters_here';to create a new user. -
CREATE DATABASE your_database_name WITH OWNER your_new_username;to create a new database, owned by your new user. - '\q' to exit psql.
- 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' ...`
-
python manage.py syncdbto bring the database into line - type 'yes' when asked whether you would like to create a Django superuser, and then typechoose_an_admin_usernameandYour Emailwhen prompted. Also, choose a memorable, but secure, password. -
python manage.py migrateto create the sitetree tables. -
python manage.py loaddata core/fixtures/initial_sitetree.jsonto load the sitetree fixtures - Edit
settings.pyto setWAIT_GET = TrueandYOUR_INSTITUTION = "Your Institution Name". - Run
python manage.py runserverto start the server. You should now be able to viewhttp://localhost:8000/in a web browser, logging in with the superuser username and password you created earlier. - Create users with the Django admin interface.
- Start loading data (see separate documentation, for example here for iTunes U monitoring).