ExperimentDB requires both a database and a webserver to be set up. Ideally, the database should be hosted separately from the webserver and ExperimentDB installation, but this is not necessary, as both can be used from the same server. If you are using a remote server for the database, it is best to set up a user for this database that can only be accessed from the webserver. If you want to set up several installations (ie for different users or different laboratories), you need separate databases and ExperimentDB installations for each. You will also need to set up the webserver with different addresses for each installation.
http://github.com/davebridges/ExperimentDB/downloads for the current release
http://github.com/davebridges/ExperimentDB for the source code
from pypi by entering:
pip install experimentdb
Downloading and/or unzipping will create a directory named ExperimentDB. You can update to the newest revision at any time either using git or downloading and re-installing the newer version. Changing or updating software versions will not alter any saved data, but you will have to update the localsettings.py file (described below).
Create a new database. You need to record the user, password, host and database name. Refer to the database documentation for how to do this with a specific database engine. If you are using SQLite3, you only need to set the engine and the database name. It is recommended to use MySQL.
Go to localsettings_empty.py and edit the settings:
ENGINE: 'mysql', 'postgresql_psycopg2' or 'sqlite3 depending on the database software used.
NAME: database name
USER: database user. Unless using sqlite3
PASSWORD: database password. Unless using sqlite3
HOST: database host.
Save this file as localsettings.py in the main ExperimentDB directory.
Run the test client by going into the experimentdb directory and running the following. There should be no errors at this point:
python manage.py test
Generate the initial database tables by entering:
python manage.py syncdb
When asked generate an administrative superuser and set the email and password.
You need to set up a server to serve both the django installation and saved files. For the saved files. I recommend using apache for both. The preferred setup is to use Apache2 with mod_wsgi. The following is a httpd.conf example where the code is placed in /usr/src/django/experimentdb:
Alias /static /usr/src/django/experimentdb/media
Alias /media /usr/src/django/experimentdb/media
<Directory /usr/src/django/experimentdb/media>
Order allow,deny
Allow from all
</Directory>
WSGIScriptAlias /experimentdb /usr/src/django/experimentdb/apache/django.wsgi
<Directory /usr/src/django/experimentdb/apache>
Order deny,allow
Allow from all
</Directory>
If you want to restrict access to these files, change the Allow from all directive to specific domains or ip addresses (for example Allow from 192.168.0.0/99 would allow from 192.168.0.0 to 192.168.0.99)