Installation of Development Environment

When installing the development environment please make sure that the you change the installation instructions below to match differences in your operating system. These instructions are heavily biased to developing portal apps and plugins on Linux and OS X.

Basic installations of Portal should match the requirements set out as detailed on the installation and settings guide, but its also recommended to install the following Python packages:

  • Python 3.7 [1]
  • ipython [2]
  • ipdb [3]
  • pip [4]
  • PIL (Python imaging library) [5]

These packages, with the exception of Python 2.6 can be installed using easy_install or PIP.

You will also need:

  • Text editor or IDE.
  • Access to change the system path variables.

Optional but helpful:

  • GUI based admin tool for the database of your choice.
  • Web browser.

The following instructions assume that you have got the Portal package and have extracted it onto a path somewhere on your machine. It doesn’t matter where, but we suggest somewhere easy for you to edit, or in the standard installation path.

The usually installation packages can be used instead of manual installation and then you can run from the command prompt as detailed below.

You are expected to have the correct license from Cantemo before you start developing with the system.

Portal installation

Please refer to the document Administration Guide

If you are developing in portal.conf you can set the DEBUG and TEMPLATE_DEBUG settings to True, so you get error messages shown in the browser window.

Logging can also be set to debug by editing logging.conf and changing all the settings to DEBUG.

Running Portal

To run Portal whilst you are editing you can run from the command line:

python manage.py runserver

Portal will be accessible from http://localhost:8000.

If you are running Portal on a server and wish to test through nginx then you can proxy using nginx. Usually we configure a gunicorn service to run on port 9000. Kill this:

sudo supervisorctl stop portal:

And then you can run from the command line in its place:

python manage.py runserver localhost:9000

You should run this from:

/opt/cantemo/portal

Warning

File upload will not work when running in this mode.

PYTHONPATH

Note

Starting from Portal 1.6 we ship our Python, its located under /opt/cantemo/python

Depending on your installation you might want to set the pythonpath to the directory one level up from the portal directory:

export PYTHONPATH=/opt/cantemo/portal/

Certain commands benefit from the doing so, and if you have multiple portal development environments in one place it certainly does benefit to have the environment paths correct. This is so that you can do imports such as:

import portal.settings

It is possible to run from virtualenv if you so need to.

Django Debug ToolBar

Django Debug Toolbar is currently not supported on Portal. If you install it you might find that Portal will not start if it’s configured to use some Apps.

[1]python.org for more information.
[2]IPython is an interactive computing environment.
[3]iPython pdb enhanced interactive Python debugger.
[4]pip installs packages. Python packages. An easy_install replacement.
[5]Python imaging library adds image processing capabilities to your Python interpreter. This library supports many file formats, and provides powerful image processing and graphics capabilities.