MouseDB requires both a database and a webserver to be set up. Ideally, the database should be hosted separately from the webserver and MouseDB 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 MouseDB installations for each. You will also need to set up the webserver with different addresses for each installation.
- Using pip or easy_install. If setuptools (available at http://pypi.python.org/pypi/setuptools) is installed type pip install mousedb at a command prompt.
- http://github.com/davebridges/mousedb/downloads for the current release. If you will not be contributing to the code, download from here.
- http://github.com/davebridges/mousedb for the source code via Git. If you might contribute code to the project use the source code.
Downloading and/or unzipping will create a directory named mousedb. 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).
- ENGINE: Choose one of ‘django.db.backends.postgresql_psycopg2’,’django.db.backends.postgresql’, ‘django.db.backends.mysql’, ‘django.db.backends.sqlite3’, ‘django.db.backends.oracle’ depending on the database software used.
- NAME: database name
- USER: database user
- PASSWORD: database password
- HOST: database host
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. See http://code.google.com/p/modwsgi/wiki/InstallationInstructions for instructions on using mod_wsgi. The following is a httpd.conf example where the code is placed in /usr/src/mousedb:
Alias /robots.txt /usr/src/mousedb/src/mousedb/media/robots.txt
Alias /favicon.ico /usr/src/mousedb/src/mousedb/media/favicon.ico
Alias /mousedb-media/ /usr/src/mousedb/src/mousedb/media/
<Directory /usr/src/mousedb/src/mousedb/media>
Order deny,allow
Allow from all
</Directory>
<Directory /usr/src/mousedb/bin>
Order deny,allow
Allow from all
</Directory>
WSGIScriptAlias /mousedb /usr/src/mousedb/bin/django.wsgi
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)
From the mousedb directory run bin\test or bin\django test to run the test suite. See https://github.com/davebridges/mousedb/wiki/Known-Issues—Test-Suite for known issues. Report any additional errors at the issue page at https://github.com/davebridges/mousedb/issues.