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 ------------------ - pip install -r requirements.txt For development/deployment, you also need: - Fabric - django-debug-toolbar - django-anonymizer - The fabfile contains info about how to develop and deploy - You need to create a cciw/settings_priv.py with the various settings that I cannot release publicly (database, passwords, secret key). To be able to deploy, you need also need settings_production.py or settings_staging.py The fabfile depends on these files existing. - 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. Tests ----- Tests can be run like so: $ fab test or $ ./manage.py test --settings=cciw.settings_tests cciw.cciwmain.tests cciw.bookings.tests cciw.officers.tests Components ---------- The major components of the site are: 1) Information about the camps that are run. This is all on publically accessible parts of the site. 2) Camp forums and photo galleries. Now largely unused. You have to log in as a Member to post content. 3) Booking - for campers (or their parents) to book places on camp and pay. 4) Admin. Used by a few people to add camp information, for example. Also used by booking secretary to add/manage information about bookings, and various other staff functions. 5) Leaders and officers. This contains utilities for leaders: * to manage an officer list for their camp * to view applications from officers * to manage references for officers * to download booking information about campers booked on the camp ...and other things It also contains utilities for officers to submit their application forms, and helps for the booking secretary. Where possible, the Django admin is used for some of these functions. Login ----- Because of the above components, there are 3 separate login systems: * The standard django.contrib.auth.User system, used by the Django admin and the officers section (staff members). * A custom login system for the camp forums, based on the Member model, (very similar to contrib.auth.User, with passwords etc.) * A custom login system for booking places on camp, which is passwordless, based on BookingAccount. Project history --------------- 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 ----------- 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. Crontab ------- CCIW_PYTHON=/home/cciw/webapps/cciw_django/venv/bin/python2.7 CCIW_MANAGE=/home/cciw/webapps/cciw_django/src/manage.py CCIW_STAGING_PYTHON=/home/cciw/webapps/cciw_staging_django/venv/bin/python2.7 CCIW_STAGING_MANAGE=/home/cciw/webapps/cciw_staging_django/src/manage.py * * * * * $CCIW_PYTHON $CCIW_MANAGE send_mail 2>> ~/.django-mailer-cron.log 5,35 * * * * $CCIW_PYTHON $CCIW_MANAGE fix_mailing_lock 0,20,40 * * * * $CCIW_PYTHON $CCIW_MANAGE retry_deferred 2>> ~/.django-mailer-deferred-cron.log 15 1 * * * $CCIW_PYTHON $CCIW_MANAGE clear_securedownload_links */10 * * * * $CCIW_PYTHON $CCIW_MANAGE process_payments 0 2 * * * $CCIW_PYTHON $CCIW_MANAGE cleanup * * * * * $CCIW_PYTHON $CCIW_MANAGE handle_mailing_lists 2>> ~/.cciw-mailings-cron.log # expire_bookings must be run only once an hour 30 * * * * $CCIW_PYTHON $CCIW_MANAGE expire_bookings */10 * * * * /home/cciw/webapps/cciw_django/venv/bin/fab -f /home/cciw/webapps/cciw_django/src/fabfile.py production local_webserver_start # expire_bookings must be run only once an hour 30 * * * * $CCIW_STAGING_PYTHON $CCIW_STAGING_MANAGE expire_bookings 18 1 * * * $CCIW_STAGING_PYTHON $CCIW_STAGING_MANAGE clear_securedownload_links 3 2 * * * $CCIW_STAGING_PYTHON $CCIW_STAGING_MANAGE cleanup
5d7b73b - Merged from default
ca81930 - Improved links for brochure/bookings spreadsheet downloads.
67e8716 - Added 'email' to brochure mailing list spreadsheet.
fad4301 - More robust way of creating default member icon
b048c56 - Added crontab info to README
b674e2f - Close branch prefetch_related.
hg strip 8152797f674ac72af3404f1577aff64b on your local copy
b674e2f - Close branch prefetch_related.
hg strip f59737c81669f8dbb2524cbc74e6aa81 on your local copy
2fdfecb - Removed some old comments
5c034d8 - Corrected versions for webtest libraries, to make tests work
d032477 - Better docs for settings_priv.py
4505074 - Corrected command for running tests
dad4128 - Corrected old import
0b36d7c - Merged from default
127b0fa - Configuration for django-wiki
5641def - Removed djiki
c3d2862 - Merged from default
631ca2a - Corrections to wiki migration script
Adding camps to site causes exception