What follows are instructions for setting up a development environment on macOS. These instructions were tested on a MacBook Pro running macOS 10.13.6 (High Sierra).
- MySQL 5.6
- Node.js 16.x
- Python 3.6
From the root of the project working directory:
export PYTHONPATH=$PWD
cd backend/mlarchive
py.test tests
py.test --flakes archive
py.test --pep8 archive
This section describes some of the parts of the system that aren't obvious.
- How are records added to the index?
In settings.py
is a setting:
HAYSTACK_SIGNAL_PROCESSOR = 'celery_haystack.signals.CelerySignalProcessor'
haystack/__init__.py
uses this to setup Django signals to save records to the index when models are saved.
CelerySignalProcessor
: when objects are save checks to see if an index exists for them. If so calls task to update index.
As of v1.12.4
, mail archive supports a "Static Mode" which resembles the MHonArc interface.
When enabled, from the Settings menu, the user is directed to /arch/browse/static/
pages.
Cloudflare has been configured to cache these pages for CACHE_CONTROL_MAX_AGE
.