cciw-website / README

CCIW source code
================

In case I get hit by a bus, or for the freak possibility that someone wants to
help me with this site, here are some tips for developers.

Installation hints
------------------

- The fabfile contains info about how to develop and deploy

- You need to create a settings_priv.py with the various settings that I cannot
  release publicly (database, passwords, secret key)

- For creating the database, there is a complete set of South migration
  scripts. However, some of the data migration scripts may depend on certain
  data being present in the database. It is therefore better to get
  a dump of live DB and use that. Use the anonymize_data command to
  clear the DB of sensitive live data.


Project organisation
--------------------

The first evolution of the project had a large models.py (cciw.cciwmain.models)
that was split into sub modules. This has now been re-organised into
cciw.cciwmain (camp and camp site information, and other core website
functionality), cciw.forums and cciw.sitecontent. cciw.officers and
cciw.bookings are newer and were written as separate apps from the start.

Although the apps have been mainly separated, there are dependencies between
them, and places where they have not been separated.

- almost all apps use cciw.cciwmain.models.Camp, and other common functionality
  found in cciwmain
- tests for forums and sitecontent remain in cciwmain. This is partly because
  cciwmain.views uses forums.views.
- test fixtures are re-used by different apps.

Other notes
-----------

A lot of this code is quite old. It has been continuously updated to work with
latest Django, and fix deprecation warnings, but might be quite different if
written from scratch. A lot of code in cciwmain, sitecontent and forums ought to
be updated to use the {% url %} tag which was added after I wrote it.

Views are done using a mixture of classic functions and Class Based Views,
depending on whether the move to CBVs was worth the effort. This means that
there is sometimes some duplication between the function based way of doing
something and the equivalent CBV way, and you need to be comfortable with both
styles.

The system was initially migrated from a PHP system. The migration scripts can
be found in the VCS history, but have been removed from the current tree
as they are clutter that is no longer needed.

Tests
=====

./manage.py test --settings=cciw.settings_tests cciwmain officers bookings
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.