Mercurial > hg > savane-forge
annotate 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 |
rev | line source |
---|---|
201 | 1 Directory layout |
2 ================ | |
3 | |
4 * 'savane/' directory contains all the python(django) code. | |
5 | |
6 * 'static_media/' all the css and images | |
7 | |
8 * 'templates/' all the templates that are necessary to run savane | |
9 | |
227
6d10f19effbf
Improve translators documentation (thanks Xavier Reina for the comments :))
Sylvain Beucler <beuc@beuc.net>
parents:
201
diff
changeset
|
10 When deploying Django, the top-level directory will be added to the |
6d10f19effbf
Improve translators documentation (thanks Xavier Reina for the comments :))
Sylvain Beucler <beuc@beuc.net>
parents:
201
diff
changeset
|
11 Python path (sys.path). So all packages are specified relative to |
6d10f19effbf
Improve translators documentation (thanks Xavier Reina for the comments :))
Sylvain Beucler <beuc@beuc.net>
parents:
201
diff
changeset
|
12 this directory. e.g.: import savane.my.views |
6d10f19effbf
Improve translators documentation (thanks Xavier Reina for the comments :))
Sylvain Beucler <beuc@beuc.net>
parents:
201
diff
changeset
|
13 |
6d10f19effbf
Improve translators documentation (thanks Xavier Reina for the comments :))
Sylvain Beucler <beuc@beuc.net>
parents:
201
diff
changeset
|
14 In particular, 'savane' is the main package. It may be installed at |
6d10f19effbf
Improve translators documentation (thanks Xavier Reina for the comments :))
Sylvain Beucler <beuc@beuc.net>
parents:
201
diff
changeset
|
15 another point of the Python path, e.g. in |
6d10f19effbf
Improve translators documentation (thanks Xavier Reina for the comments :))
Sylvain Beucler <beuc@beuc.net>
parents:
201
diff
changeset
|
16 '/usr/share/pyshared/savane', in which case the top-level directory |
6d10f19effbf
Improve translators documentation (thanks Xavier Reina for the comments :))
Sylvain Beucler <beuc@beuc.net>
parents:
201
diff
changeset
|
17 will only contain installation-specific files: 'manage.py', |
6d10f19effbf
Improve translators documentation (thanks Xavier Reina for the comments :))
Sylvain Beucler <beuc@beuc.net>
parents:
201
diff
changeset
|
18 'settings.py', and 'url.py'. |
6d10f19effbf
Improve translators documentation (thanks Xavier Reina for the comments :))
Sylvain Beucler <beuc@beuc.net>
parents:
201
diff
changeset
|
19 |
201 | 20 |
104
9088bf1ac7c6
Mention convenient IPython trick: auto-import django models
Sylvain Beucler <beuc@beuc.net>
parents:
diff
changeset
|
21 Debugging |
9088bf1ac7c6
Mention convenient IPython trick: auto-import django models
Sylvain Beucler <beuc@beuc.net>
parents:
diff
changeset
|
22 ========= |
9088bf1ac7c6
Mention convenient IPython trick: auto-import django models
Sylvain Beucler <beuc@beuc.net>
parents:
diff
changeset
|
23 |
9088bf1ac7c6
Mention convenient IPython trick: auto-import django models
Sylvain Beucler <beuc@beuc.net>
parents:
diff
changeset
|
24 To autoload Django models when running './manage.py shell', check: |
9088bf1ac7c6
Mention convenient IPython trick: auto-import django models
Sylvain Beucler <beuc@beuc.net>
parents:
diff
changeset
|
25 http://www.djangosnippets.org/snippets/549/ |
9088bf1ac7c6
Mention convenient IPython trick: auto-import django models
Sylvain Beucler <beuc@beuc.net>
parents:
diff
changeset
|
26 |
9088bf1ac7c6
Mention convenient IPython trick: auto-import django models
Sylvain Beucler <beuc@beuc.net>
parents:
diff
changeset
|
27 This requires IPython, which adds completion and other niceties to the |
9088bf1ac7c6
Mention convenient IPython trick: auto-import django models
Sylvain Beucler <beuc@beuc.net>
parents:
diff
changeset
|
28 Python shell. |
135
92e789878e81
Tip zeus about how to avoid messy Git merges :P
Sylvain Beucler <beuc@beuc.net>
parents:
104
diff
changeset
|
29 |
92e789878e81
Tip zeus about how to avoid messy Git merges :P
Sylvain Beucler <beuc@beuc.net>
parents:
104
diff
changeset
|
30 |
92e789878e81
Tip zeus about how to avoid messy Git merges :P
Sylvain Beucler <beuc@beuc.net>
parents:
104
diff
changeset
|
31 Git |
92e789878e81
Tip zeus about how to avoid messy Git merges :P
Sylvain Beucler <beuc@beuc.net>
parents:
104
diff
changeset
|
32 === |
92e789878e81
Tip zeus about how to avoid messy Git merges :P
Sylvain Beucler <beuc@beuc.net>
parents:
104
diff
changeset
|
33 |
92e789878e81
Tip zeus about how to avoid messy Git merges :P
Sylvain Beucler <beuc@beuc.net>
parents:
104
diff
changeset
|
34 Do avoid messy merges whenever you forgot to make a 'git pull' before |
92e789878e81
Tip zeus about how to avoid messy Git merges :P
Sylvain Beucler <beuc@beuc.net>
parents:
104
diff
changeset
|
35 starting to work, check: |
92e789878e81
Tip zeus about how to avoid messy Git merges :P
Sylvain Beucler <beuc@beuc.net>
parents:
104
diff
changeset
|
36 |
136
e05c2c20a61a
Fix rebase instructions (worked for branches apparently, not when pulling the current branch)
Sylvain Beucler <beuc@beuc.net>
parents:
135
diff
changeset
|
37 git config branch.master.rebase true |
135
92e789878e81
Tip zeus about how to avoid messy Git merges :P
Sylvain Beucler <beuc@beuc.net>
parents:
104
diff
changeset
|
38 |
92e789878e81
Tip zeus about how to avoid messy Git merges :P
Sylvain Beucler <beuc@beuc.net>
parents:
104
diff
changeset
|
39 This makes your latest changes much clearer. |
92e789878e81
Tip zeus about how to avoid messy Git merges :P
Sylvain Beucler <beuc@beuc.net>
parents:
104
diff
changeset
|
40 |
136
e05c2c20a61a
Fix rebase instructions (worked for branches apparently, not when pulling the current branch)
Sylvain Beucler <beuc@beuc.net>
parents:
135
diff
changeset
|
41 Beware that rebase can be a dangerous tool - better issue a 'gitk' |
e05c2c20a61a
Fix rebase instructions (worked for branches apparently, not when pulling the current branch)
Sylvain Beucler <beuc@beuc.net>
parents:
135
diff
changeset
|
42 before pushing, as a rule of the thumb, and rebase as necessary. |
e05c2c20a61a
Fix rebase instructions (worked for branches apparently, not when pulling the current branch)
Sylvain Beucler <beuc@beuc.net>
parents:
135
diff
changeset
|
43 |
e05c2c20a61a
Fix rebase instructions (worked for branches apparently, not when pulling the current branch)
Sylvain Beucler <beuc@beuc.net>
parents:
135
diff
changeset
|
44 More in-depth explanation with examples (though the author works on a |
e05c2c20a61a
Fix rebase instructions (worked for branches apparently, not when pulling the current branch)
Sylvain Beucler <beuc@beuc.net>
parents:
135
diff
changeset
|
45 fork, not on the project master branch): |
135
92e789878e81
Tip zeus about how to avoid messy Git merges :P
Sylvain Beucler <beuc@beuc.net>
parents:
104
diff
changeset
|
46 - http://www.gitready.com/advanced/2009/02/11/pull-with-rebase.html |
201 | 47 |
48 | |
49 Testing | |
50 ======= | |
51 | |
52 You need to create a test_savane database: | |
53 | |
54 mysql -e "CREATE DATABASE test_savane DEFAULT CHARACTER SET utf8;" | |
55 mysql -e "GRANT ALL PRIVILEGES ON test_savane.* TO 'savane' IDENTIFIED BY 'yourpass';" | |
56 | |
57 Run your tests with:: | |
58 | |
59 ./manage.py test svmain my |