Devilry does not come pre-packaged. Instead, we deploy using buildout. There is several reasons for that:
What this means for you is that you have to setup a very minimal buildout-config instead of downloading an archive and unzipping it.
You should run Devilry as a non-privledged user. We suggest you name the user something like devilryrunner. Run all commands in this documentation as this user unless stated otherwise.
Create a directory that will be used to configure your Devilry build:
$ mkdir devilrybuild
Create a configuration file named buildout.cfg in the directory. Add the following to the configuration file:
[buildout]
extends = https://raw.github.com/devilry/devilry-deploy/REVISION/buildout/buildout-base.cfg
Replace REVISION (in the extends url) with the Devilry version you want to use (E.g.: v1.2.1). See the tag listing on github for a list of all releases, and refer to The releasenotes listing for the information about each release.
CD to the directory and run the following commands to download Devilry and all dependencies into a Python virtualenv. The end result is a selfcontained devilry build that only depends on the availability of a compatible Python interpreter to run. The virtualenv is not affected by other Python packages installed globally:
$ cd devilrybuild/
$ mkdir -p buildoutcache/dlcache
$ virtualenv --no-site-packages .
$ bin/easy_install zc.buildout
$ bin/buildout "buildout:parts=download-devilryrepo" && bin/buildout
To configure Devilry, you need to create a Python module containing a config-file named devilry_prod_settings.py. First create a directory for your Devilry configurations:
$ mkdir /etc/devilry
turn the directory into a Python module:
$ touch /etc/devilry/__init__.py
and add your own devilry_prod_settings.py to the directory. This is a good starting point:
# Import the default settings from devilry
from devilry_settings.default_settings import *
#################################################################################
# Configure the database
#################################################################################
DATABASES = {}
DATABASES["default"] = {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'djangodb',
'USER': 'djangouser',
'PASSWORD': 'supersecret',
'HOST': 'localhost',
}
##################################################################################
# Make Devilry speak in typical university terms (semester instead of period, ...)
##################################################################################
INSTALLED_APPS += ['devilry_university_translations']
DEVILRY_JAVASCRIPT_LOCALE_OVERRIDE_APPS = ('devilry_university_translations',)
#################################################################################
# Email settings
#################################################################################
#: Default from email - students receive emails from this address when they make deliveries
DEVILRY_EMAIL_DEFAULT_FROM = 'devilry-support@example.com'
#: The URL that is used to link back to devilry from emails
DEVILRY_SCHEME_AND_DOMAIN = 'https://devilry.example.com'
#: Configure an email backend (see the docs for more info)
#EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
#EMAIL_HOST_USER = ''
#EMAIL_HOST_PASSWORD = ''
#EMAIL_PORT = 25
#EMAIL_USE_TLS = False
##################################################################################
# Other settings
##################################################################################
#: Where should Devilry store your files
DEVILRY_FSHIERDELIVERYSTORE_ROOT = '/devilry-filestorage'
#: Randomize this, and keep it secret
SECRET_KEY = '+g$%**q(w78xqa_2)(_+%v8d)he-b_^@d*pqhq!#2p*a7*9e9h'
#: Turn this on if you need to debug Devilry
DEBUG = False
EXTJS4_DEBUG = DEBUG
#: Change this to the name of the system which you fetch data into Devilry from.
DEVILRY_SYNCSYSTEM = 'The Devilry demo syncsystem'
#: Url where users are directed when they do not have the permissions they believe they should have.
DEVILRY_LACKING_PERMISSIONS_URL = None
#: Url where users are directed when they want to know what to do if their personal info in Devilry is wrong.
DEVILRY_WRONG_USERINFO_URL = None
#: Deadline handling method:
#:
#: 0: Soft deadlines
#: 1: Hard deadlines
DEFAULT_DEADLINE_HANDLING_METHOD = 0
The config-file can contain any official Django settings, and Devilry provides some extra settings that should be useful:
When you have configured a database in devilry_prod_settings.py, you can use the following command to create your database:
$ cd /path/to/devilrybuild
$ bin/django.py syncdb
The script will ask you to create a superuser. Choose a strong password - this user will have complete access to everything in Devilry.
See Debug problems.
Collect all static files in the static/-subdirectory:
$ bin/django.py collectstatic
All Devilry services is controlled to Supervisord. This does not include your database or webserver.
To run supervisord in the foreground for testing/debugging, enable DEBUG-mode (see Debug problems), and run:
$ bin/supervisord -n
Make sure you disable DEBUG-mode afterwards.
To run supervisord in the background with a PID, run:
$ bin/supervisord
See Configure supervisord (logging, pidfile, ...) to see and configure where the PID-file is written, and for an init-script example.
Warning
Do NOT run supervisord as root. Run it as an unpriviledged used, preferably a user that is only used for Devilry. Use the supervisord-user, as shown in Configure supervisord (logging, pidfile, ...), to define a user if running supervisord as root.
You need to configure your webserver to act as a reverse proxy for all URLS except for the /static/-url. The proxy should forward requests to the Devilry WSGI server (gunicorn). Gunicorn runs on 127.0.0.0:8002.
The webserver should use SSL.