view doc/HACKING @ 328:91a6a6c540d4

Static fields definition won't be interesting in the long run
author Sylvain Beucler <beuc@beuc.net>
date Sun, 22 Aug 2010 08:41:38 +0200
parents 6d10f19effbf
children
line wrap: on
line source

Directory layout
================

* 'savane/' directory contains all the python(django) code.

* 'static_media/' all the css and images

* 'templates/' all the templates that are necessary to run savane

When deploying Django, the top-level directory will be added to the
Python path (sys.path).  So all packages are specified relative to
this directory.  e.g.: import savane.my.views

In particular, 'savane' is the main package.  It may be installed at
another point of the Python path, e.g. in
'/usr/share/pyshared/savane', in which case the top-level directory
will only contain installation-specific files: 'manage.py',
'settings.py', and 'url.py'.


Debugging
=========

To autoload Django models when running './manage.py shell', check:
http://www.djangosnippets.org/snippets/549/

This requires IPython, which adds completion and other niceties to the
Python shell.


Git
===

Do avoid messy merges whenever you forgot to make a 'git pull' before
starting to work, check:

  git config branch.master.rebase true

This makes your latest changes much clearer.

Beware that rebase can be a dangerous tool - better issue a 'gitk'
before pushing, as a rule of the thumb, and rebase as necessary.

More in-depth explanation with examples (though the author works on a
fork, not on the project master branch):
- http://www.gitready.com/advanced/2009/02/11/pull-with-rebase.html


Testing
=======

You need to create a test_savane database:

  mysql -e "CREATE DATABASE test_savane DEFAULT CHARACTER SET utf8;"
  mysql -e "GRANT ALL PRIVILEGES ON test_savane.* TO 'savane' IDENTIFIED BY 'yourpass';"

Run your tests with::

  ./manage.py test svmain my