CDH website documentation

Build status Code Health Code coverage Requirements Status

Python 3.5 / Django 1.11 / Node 8.16.0 / MariaDB (MySQL) 5.5 w/ timezone info

cdhweb is a Django+Mezzanine application that powers the CDH website with custom models for people, events, and projects.

View software and architecture documentation for the current release.

This repository uses git-flow conventions; master contains the most recent release, and work in progress will be on the develop branch. Pull requests should be made against develop.

Development instructions

Initial setup and installation:

  • Recommended: create and activate a python 3.5 virtualenv:

    virtualenv cdhweb -p python3.5
    source cdhweb/bin/activate
    
  • Use pip to install required python dependencies. To install production dependencies only:

    pip install -r requirements.txt
    

    To install all development requirements:

    pip install -r requirements/dev.txt
    
  • Copy sample local settings and configure for your environment:

    cp cdhweb/local_settings.py.sample cdhweb/local_settings.py
    
  • Download licensed fonts and install locally under /sitemedia/fonts/

  • django-compressor dependencies: install sass for your operating system as appropriate. If you have Ruby gems installed, gem install sass. Also install Node.js and npm. Globally install postcss-cli and autoprefixer, i.e. npm -g postcss-cli autoprefixer. You may need sudo for these operations.

  • If running this application on MariaDB/MySQL, you must make sure that time zone definitions are installed. On most flavors of Linux/MacOS, you may use the following command, which will prompt for the database server’s root password:

    mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql -p
    

    If this command does not work, make sure you have the command line utilities for MariaDB/MySQL installed and consult the documentation for your OS for timezone info. Windows users will need to install a copy of the zoneinfo files.

    See MariaDB’s info on the utility for more information.

Unit Testing

Unit tests are written with py.test but use Django fixture loading and convenience testing methods when that makes things easier. To run them, first install test requirements (these are included in dev):

pip install -r requirements/test.txt

Run tests using py.test:

py.test

Documentation

Documentation is generated using sphinx To generate documentation, first install development requirements:

pip install -r requirements/dev.txt

Then build the documentation using the customized make file in the docs directory:

cd sphinx-docs
make html

When building documentation for a production release, use make docs to update the published documentation on GitHub Pages.

Indices and tables