/mailarch

Primary LanguagePython

DEVELOPMENT AND TESTING
-----------------------

What follows are instructions for setting up a development
environment on Mac OSX.  These instructions were tested
on a MacBook Pro running OSX 10.13.6 (High Sierra) 

Prerequisites:
- MySQL 5.6
- Python 2.7



RUNNING TESTS
---------------------------
- cd to root of working directory
- export PYTHONPATH=$PWD
- cd mlarchive
- py.test tests
- py.test --flakes archive
- py.test --pep8 archive



NOTES ON INFRASTRUCTURE
-----------------------

This section describes some of the parts of the system that aren't obvious.

1) 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.


CDN INTEGRATION (Cloudflare)
----------------------------
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.