Important changes to econsensus's develop branch

17 views
Skip to first unread message

Jo Paulger

unread,
Jun 24, 2013, 1:19:25 PM6/24/13
to econsens...@googlegroups.com, Hamish Downer
I've merged Hamish's dye branch of econsensus into develop! Dye is a separate django app that centralises the deployment scripts for aptivate django projects which means that econsensus can benefit from improvements made to those scripts as a result of all other aptivate projects. We can control the version of the dye library that we use in econsensus by means of the commit number specified against dye in the pip_packages.txt file:

-e git+git://github.com/aptivate/dye.git@a74e9733852274c3df14a2cab494d2368cdd93d0#egg=dye

The first big improvement we get straight away is that updating the virtual env (the old update_ve stage) is now much quicker because the dye code only updates those packages that actually need updating (the old code deleted the virtual environment and started from scratch each time). Please note though that any pip installs that do need doing will be as slow as https://pypi.python.org/pypi is feeling at the time, and that creating the virtual env from scratch is likely to take about the same time that it always did (we're still using pip install).

This merge also upgrades the version of Django that we're using from 1.4 to 1.4.5 (see here and here for details) so we now have all the recommended security fixes for Django 1.4.

This merge introduces some changes that you need to be aware of:

- some files and directories have been moved from django/econsensus/ to django/econsensus/econsensus/:
  - urls.py (ie the project's root urls.py)
  - settings.py
  - all local_settings.py.* flavours including local_settings.py.dev which you'll have been using unless you've changed it manually.
  - the local_settings.py symlink will now be created in here as well
  - econsensus.sqlite (your sqlite db file)
  - econsensus-messages directory (which contains any emails generated by your dev econsensus).
- to update your virtual env you now do ./deploy/bootstrap.py (used to be cd django/econsensus/; ./manage.py update_ve). When your virtual env needs updating, the message telling you what to do has been updated to reflect this.
- running tasks.py deploy:dev *will now run collectstatic* which will create a new directory django/econsensus/static, where django/econsensus/static/css/ will contain a copy of publicweb's two stylesheets. Please be aware however that the django dev server ('runserver') does not serve stylesheets from here. Please therefore ignore those stylesheets and only make your changes to django/econsensus/publicweb/static/css/*.css . You can delete django/econsensus/static if you wish, but just be aware that it will be re-created each time you run tasks.py deploy:dev. I'll try and figure out a reliable way of not running this for dev installs again (kanban card). For more information about collectstatic if you're curious, see the relevant django docs)
- for those with server deploy permissions, the process has only changed in that where you used to type 'fab', you now type 'fab.py' (eg. fab.py staging deploy ...)

I recommend that you finish any branches that you're currently working on, submit pull requests for them, and then before starting your next development branch, upgrade your local develop branch and your checkout to the new structure described above as follows:
- # from the root dir of your econsensus checkout with no local changes, checkout the develop branch, and update it:
- git checkout develop
- git fetch upstream 
- git merge upstream/develop 
- # move your current sqlite db file to its new home:
- mv django/econsensus/econsensus.sqlite django/econsensus/econsensus/
- # if you've ever used a mysql db locally, you'll probably have a file called private_settings.py which needs to move:
- mv django/econsensus/private_settings.py django/econsensus/econsensus
- # To avoid confusion, move your econsensus-messages directory to its new home:
- mv django/econsensus/econsensus-messages/ django/econsensus/econsensus/
- # Now run bootstrap to update your virtual env (including installing the dye library and upgrading Django) and update your git submodules:
./deploy/bootstrap.py
- # Now run tasks.py to do the rest of the setup, including creating the local_settings symlink in its new dir:
./deploy/tasks.py deploy:dev
- # If you ever created any custom flavours of local_settings.py, they'll still be in django/econsensus/. If you still need them, move them to django/econsensus/econsensus/, or delete them as you wish.
- # To tidy up, delete the old (now broken) symlink (the one that econsensus now needs will have been created in django/econsensus/econsensus/ for you):
- rm django/econsensus/local_settings.py

If you have any problems with the above, drop me an email or come over and shout for help :D

Jo

Reply all
Reply to author
Forward
0 new messages