1
by Gediminas Paulauskas
Import upstream version 1.6.0~a1 |
1 |
SchoolTool |
2 |
========== |
|
3 |
||
1.1.9
by Gediminas Paulauskas
Import upstream version 2.0.1 |
4 |
SchoolTool: the Global Student Information System |
1
by Gediminas Paulauskas
Import upstream version 1.6.0~a1 |
5 |
|
1.1.5
by Gediminas Paulauskas
Import upstream version 1.9.1 |
6 |
| Website: http://www.schooltool.org/ |
1.1.9
by Gediminas Paulauskas
Import upstream version 2.0.1 |
7 |
| Documentation: http://book.schooltool.org/ |
1.1.5
by Gediminas Paulauskas
Import upstream version 1.9.1 |
8 |
| Mailing list: https://launchpad.net/~schooltoolers |
9 |
| Bug tracker: http://bugs.launchpad.net/schooltool |
|
1
by Gediminas Paulauskas
Import upstream version 1.6.0~a1 |
10 |
|
11 |
||
12 |
Overview |
|
13 |
-------- |
|
14 |
||
1.1.9
by Gediminas Paulauskas
Import upstream version 2.0.1 |
15 |
SchoolTool is an open source, web based student information system designed for |
16 |
schools in the developing world, with strong support for translation, |
|
17 |
localization and automated deployment and updates on Ubuntu. |
|
1
by Gediminas Paulauskas
Import upstream version 1.6.0~a1 |
18 |
|
19 |
||
20 |
System requirements |
|
21 |
------------------- |
|
22 |
||
23 |
- Python (http://www.python.org/) |
|
24 |
||
25 |
- libicu-dev: International Components for Unicode libraries (http://icu.sourceforge.net/download/) |
|
26 |
||
27 |
- the Python Imaging Library (PIL) (http://www.pythonware.com/products/pil/) |
|
28 |
||
29 |
- (optional) the ReportLab Toolkit (http://www.reportlab.org), and |
|
30 |
Liberation TrueType fonts. ReportLab is only needed if you want to |
|
31 |
generate PDF reports and calendars. To enable PDF support you will |
|
32 |
need to specify the path to fonts in the configuration file. |
|
33 |
||
1.1.9
by Gediminas Paulauskas
Import upstream version 2.0.1 |
34 |
On Ubuntu (or Debian), you can install the needed tools and libraries by:: |
35 |
||
36 |
$ make ubuntu-environment |
|
37 |
||
38 |
If that suceeded, you can skip to `Building SchoolTool from Source`_. |
|
39 |
||
40 |
What is being installed, is detailed below. |
|
41 |
||
42 |
Basic C development tools:: |
|
1.1.5
by Gediminas Paulauskas
Import upstream version 1.9.1 |
43 |
|
44 |
$ sudo apt-get install build-essential |
|
45 |
||
1.1.9
by Gediminas Paulauskas
Import upstream version 2.0.1 |
46 |
Python development libraries and virtualenv:: |
47 |
||
48 |
$ sudo apt-get install python-dev python-virtualenv |
|
49 |
||
50 |
Unicode library:: |
|
1.1.5
by Gediminas Paulauskas
Import upstream version 1.9.1 |
51 |
|
52 |
$ sudo apt-get install libicu-dev |
|
53 |
||
1.1.9
by Gediminas Paulauskas
Import upstream version 2.0.1 |
54 |
Python Imaging Library, to build it you need freetype and jpeg development libraries:: |
55 |
||
56 |
$ sudo apt-get install libfreetype6-dev libjpeg62-dev |
|
57 |
||
58 |
gettext, needed to compile translations:: |
|
59 |
||
60 |
$ sudo apt-get install gettext |
|
61 |
||
62 |
For PDF generation to work need fonts:: |
|
1.1.5
by Gediminas Paulauskas
Import upstream version 1.9.1 |
63 |
|
64 |
$ sudo apt-get install ttf-liberation |
|
65 |
||
1.1.9
by Gediminas Paulauskas
Import upstream version 2.0.1 |
66 |
Other tools:: |
67 |
||
68 |
$ sudo apt-get install libxslt1-dev enscript |
|
69 |
||
70 |
||
71 |
Building SchoolTool from source |
|
72 |
------------------------------- |
|
73 |
||
1.1.5
by Gediminas Paulauskas
Import upstream version 1.9.1 |
74 |
Run ``make`` to download and install all the required zope packages into |
75 |
the eggs folder:: |
|
76 |
||
77 |
$ make |
|
78 |
||
1.1.9
by Gediminas Paulauskas
Import upstream version 2.0.1 |
79 |
It is a good idea to run tests to check the installation:: |
1.1.5
by Gediminas Paulauskas
Import upstream version 1.9.1 |
80 |
|
81 |
$ make test ftest |
|
82 |
||
1.1.9
by Gediminas Paulauskas
Import upstream version 2.0.1 |
83 |
If you are running from a bzr checkout, you need to compile translation |
84 |
catalogs:: |
|
85 |
||
86 |
$ make compile-translations |
|
87 |
||
88 |
||
89 |
Creating a SchoolTool Instance |
|
90 |
------------------------------ |
|
91 |
||
92 |
An "instance" is a set of configuration files and data directories, that contain |
|
93 |
everything needed to run a server for one school. |
|
94 |
||
95 |
Let's create one:: |
|
1.1.5
by Gediminas Paulauskas
Import upstream version 1.9.1 |
96 |
|
97 |
$ make instance |
|
98 |
||
1.1.9
by Gediminas Paulauskas
Import upstream version 2.0.1 |
99 |
An instance of SchoolTool is created in the ``instance`` directory. |
100 |
||
101 |
Database is ZODB_, in a single file ``instance/Data.fs``. |
|
102 |
||
103 |
Location of the database, logs, and a few other options can be changed in a |
|
104 |
configuration file ``instance/schooltool.conf``. |
|
105 |
||
106 |
One of the options is developer mode, that allows you to add sample data, |
|
1.1.16
by Gediminas Paulauskas
Import upstream version 2.4~a1 |
107 |
introspect the database, and other useful things. Uncomment a |
1.1.9
by Gediminas Paulauskas
Import upstream version 2.0.1 |
108 |
line that says ``devmode on``. You don't want to leave this on for a production |
109 |
server, however. |
|
110 |
||
111 |
.. _ZODB: http://zodb.org |
|
1
by Gediminas Paulauskas
Import upstream version 1.6.0~a1 |
112 |
|
113 |
||
114 |
Running SchoolTool |
|
115 |
------------------ |
|
116 |
||
1.1.5
by Gediminas Paulauskas
Import upstream version 1.9.1 |
117 |
To start:: |
118 |
||
119 |
$ make run |
|
120 |
||
121 |
Once the server is running, go to http://127.0.0.1:7080 in the browser. |
|
122 |
||
1.1.9
by Gediminas Paulauskas
Import upstream version 2.0.1 |
123 |
Server is started on local port 7080. You can change the port in the file |
124 |
``instance/paste.ini``. |
|
125 |
||
126 |
You will most likely want to make SchoolTool available on port 80. But this port |
|
127 |
is reserved for the web the server. You will have to configure a virtual host or |
|
128 |
a path in web server configuration. See `Virtual Hosting`_. |
|
129 |
||
1.1.5
by Gediminas Paulauskas
Import upstream version 1.9.1 |
130 |
|
131 |
Securing SchoolTool |
|
132 |
------------------- |
|
133 |
||
134 |
Beware that the file which contains the database, `Data.fs`, is not given any |
|
1
by Gediminas Paulauskas
Import upstream version 1.6.0~a1 |
135 |
special permissions to prevent it from being read by other users by default. |
136 |
You will have to change the umask or the permissions of the file manually to |
|
137 |
prevent unauthorized access. |
|
138 |
||
1.1.5
by Gediminas Paulauskas
Import upstream version 1.9.1 |
139 |
By default a user with administrator privileges is created in the new database. |
140 |
||
141 |
| Username: manager |
|
142 |
| Password: schooltool |
|
143 |
||
144 |
You SHOULD change the password after your first login by clicking on `SchoolTool |
|
145 |
Administrator` in the top right and then `Change password` in the left sidebar. |
|
1
by Gediminas Paulauskas
Import upstream version 1.6.0~a1 |
146 |
|
147 |
||
1.1.9
by Gediminas Paulauskas
Import upstream version 2.0.1 |
148 |
Project structure |
149 |
----------------- |
|
1.1.5
by Gediminas Paulauskas
Import upstream version 1.9.1 |
150 |
|
151 |
:: |
|
1
by Gediminas Paulauskas
Import upstream version 1.6.0~a1 |
152 |
|
153 |
GPL.txt the GNU General Public License, version 2 |
|
154 |
README.txt this file |
|
1.1.5
by Gediminas Paulauskas
Import upstream version 1.9.1 |
155 |
CHANGES.txt release change log |
1
by Gediminas Paulauskas
Import upstream version 1.6.0~a1 |
156 |
|
157 |
Makefile makefile for building extension modules |
|
158 |
setup.py distutils setup script for building extension modules |
|
159 |
||
1.1.5
by Gediminas Paulauskas
Import upstream version 1.9.1 |
160 |
bin/ scripts |
1
by Gediminas Paulauskas
Import upstream version 1.6.0~a1 |
161 |
build/ temporary files are placed here during build process |
162 |
coverage/ unit test coverage reports (produced by make coverage) |
|
163 |
reports/ html version of the above (make coverage-reports-html) |
|
1.1.5
by Gediminas Paulauskas
Import upstream version 1.9.1 |
164 |
docs/ documentation |
165 |
instance/ configuration and data |
|
166 |
log/ log files |
|
167 |
paste.ini WSGI server configuration |
|
168 |
schooltool.conf schooltool configuration |
|
169 |
site.zcml site definition |
|
170 |
var/ data files |
|
171 |
Data.fs the database |
|
1
by Gediminas Paulauskas
Import upstream version 1.6.0~a1 |
172 |
src/ source code |
173 |
schooltool/ Python package 'schooltool' |
|
174 |
||
175 |
||
176 |
Testing |
|
177 |
------- |
|
178 |
||
179 |
There are two sets of automated tests: unit tests and functional tests. |
|
180 |
Unit tests (sometimes also called programmer tests) test individual components |
|
181 |
of the system. Functional tests (also called customer or acceptance tests) |
|
182 |
test only externally visible behaviour of the whole system. |
|
183 |
||
184 |
Tests themselves are scattered through the whole source tree. Subdirectories |
|
1.1.5
by Gediminas Paulauskas
Import upstream version 1.9.1 |
185 |
named `tests` contain unit tests, while subdirectories named `ftests` contain |
1
by Gediminas Paulauskas
Import upstream version 1.6.0~a1 |
186 |
functional tests. |
187 |
||
1.1.5
by Gediminas Paulauskas
Import upstream version 1.9.1 |
188 |
To run all unit tests:: |
189 |
||
190 |
$ bin/test -u |
|
191 |
||
192 |
To run all functional tests:: |
|
193 |
||
194 |
$ bin/test -f |
|
195 |
||
196 |
The test runner has more options and features. To find out about them:: |
|
197 |
||
198 |
$ bin/test -h |
|
1
by Gediminas Paulauskas
Import upstream version 1.6.0~a1 |
199 |
|
200 |
||
201 |
Unit test coverage |
|
202 |
------------------ |
|
203 |
||
204 |
All code should be covered by unit tests. The test runner can help you look |
|
205 |
for untested code by producing code coverage reports. |
|
206 |
||
1.1.5
by Gediminas Paulauskas
Import upstream version 1.9.1 |
207 |
To generate unit test coverage reports, run:: |
1
by Gediminas Paulauskas
Import upstream version 1.6.0~a1 |
208 |
|
1.1.5
by Gediminas Paulauskas
Import upstream version 1.9.1 |
209 |
$ make coverage |
1
by Gediminas Paulauskas
Import upstream version 1.6.0~a1 |
210 |
|
211 |
This command will run the full SchoolTool unit test suite and produce a |
|
1.1.5
by Gediminas Paulauskas
Import upstream version 1.9.1 |
212 |
number of files (one for each Python module) in `./coverage/`. Every |
1
by Gediminas Paulauskas
Import upstream version 1.6.0~a1 |
213 |
report file contains the source of the corresponding Python module. |
214 |
Each source line is annotated with a number that shows how many times |
|
215 |
this line was reached during testing. Watch out for lines marked with |
|
1.1.5
by Gediminas Paulauskas
Import upstream version 1.9.1 |
216 |
``>>>>>>`` as they indicate code that is not unit tested. |
217 |
||
218 |
A prettier HTML version of the coverage reports can be generated with:: |
|
219 |
||
220 |
$ make coverage-reports-html |
|
221 |
||
222 |
Look at HTML files in `./coverage/reports/`. You should have enscript installed |
|
1
by Gediminas Paulauskas
Import upstream version 1.6.0~a1 |
223 |
for syntax highlighting source files. |
224 |
||
225 |
The HTML version of coverage reports is published nightly at |
|
226 |
http://source.schooltool.org/coverage/ |
|
227 |
||
228 |
||
229 |
Translation |
|
230 |
----------- |
|
231 |
||
1.1.5
by Gediminas Paulauskas
Import upstream version 1.9.1 |
232 |
Translation template is `src/schooltool/locales/schooltool.pot`, there are |
233 |
translatable strings extracted from source. Translation templates are used |
|
234 |
to update translations and create new ones. To regenerate the template:: |
|
1
by Gediminas Paulauskas
Import upstream version 1.6.0~a1 |
235 |
|
236 |
$ make extract-translations |
|
237 |
||
1.1.5
by Gediminas Paulauskas
Import upstream version 1.9.1 |
238 |
Translation files live in `src/schooltool/locales`. There is a |
239 |
directory for each language that contains a subdirectory |
|
240 |
`LC_MESSAGES` that contains the compiled `.mo` files. |
|
241 |
The `.mo` files must be present if schooltool is to use them and are |
|
242 |
built by the command:: |
|
1
by Gediminas Paulauskas
Import upstream version 1.6.0~a1 |
243 |
|
244 |
$ make compile-translations |
|
245 |
||
1.1.5
by Gediminas Paulauskas
Import upstream version 1.9.1 |
246 |
To start a new translation, use `src/schooltool/locales/schooltool.pot` as a |
247 |
template (copy it to YOUR_LANG.po). Generate `.mo` files with ``msgfmt`` (or |
|
248 |
``make compile-translations``). |
|
1
by Gediminas Paulauskas
Import upstream version 1.6.0~a1 |
249 |
|
250 |
||
251 |
Virtual hosting |
|
252 |
--------------- |
|
253 |
||
1.1.9
by Gediminas Paulauskas
Import upstream version 2.0.1 |
254 |
SchoolTool provides support for virtual hosting with Apache's mod_proxy_. The |
255 |
standard instance is running on port 7080. You want to make it available on |
|
256 |
``school1.example.org`` port 80. Add the following to your Apache configuration, |
|
257 |
best place it in a separate file ``/etc/apache/sites-available/school1.example.org``:: |
|
1
by Gediminas Paulauskas
Import upstream version 1.6.0~a1 |
258 |
|
259 |
<VirtualHost *:80> |
|
260 |
ServerName school1.example.org |
|
1.1.9
by Gediminas Paulauskas
Import upstream version 2.0.1 |
261 |
|
262 |
<Proxy *> |
|
263 |
order allow,deny |
|
264 |
allow from all |
|
265 |
deny from none |
|
266 |
</Proxy> |
|
267 |
||
268 |
ProxyPass / http://127.0.0.1:7080/++vh++http:school1.example.org:80/++/ |
|
269 |
||
270 |
</VirtualHost> |
|
271 |
||
272 |
You need to enable Apache modules ``mod_proxy`` and ``mod_proxy_http``:: |
|
273 |
||
274 |
$ sudo a2enmod proxy_http |
|
275 |
||
276 |
Then enable the site and restart apache:: |
|
277 |
||
278 |
$ sudo a2ensite school1.example.org |
|
279 |
$ sudo service apache reload |
|
280 |
||
281 |
If you cannot, or don't want to, setup a subdomain for schooltool, you can make |
|
282 |
it available at a custom path on another site, e.g. ``example.org/schooltool``. |
|
283 |
Place the path before the last ``++`` in the URL, and put it somewhere in |
|
284 |
the configuration of that site:: |
|
285 |
||
286 |
ProxyPass /schooltool http://127.0.0.1:7080/++vh++http:example.org:80/schooltool/++/ |
|
287 |
||
288 |
For more information, see `Setting Up Virtual Hosting`_ in Zope documentation. |
|
289 |
||
290 |
.. _mod_proxy: http://httpd.apache.org/docs/current/mod/mod_proxy.html |
|
291 |
.. _Setting Up Virtual Hosting: http://wiki.zope.org/zope3/virtualhosting.html |
|
292 |
||
293 |
||
294 |
HTTPS |
|
295 |
----- |
|
296 |
||
297 |
It is recommmended to use HTTPS/SSL to best protect your users. The |
|
298 |
configuration is similar, just use port 443 and https instead of http:: |
|
1
by Gediminas Paulauskas
Import upstream version 1.6.0~a1 |
299 |
|
300 |
<VirtualHost *:443> |
|
301 |
ServerName school1.example.org |
|
1.1.9
by Gediminas Paulauskas
Import upstream version 2.0.1 |
302 |
|
303 |
SSLEngine On |
|
304 |
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem |
|
305 |
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.pem |
|
306 |
||
307 |
<Proxy *> |
|
308 |
order allow,deny |
|
309 |
allow from all |
|
310 |
deny from none |
|
311 |
</Proxy> |
|
312 |
||
313 |
ProxyPass / http://localhost:7080/++vh++https:school1.example.org:443/++/ |
|
314 |
||
315 |
</VirtualHost> |
|
316 |
||
317 |
For SSL to work, you need a SSL certificate. Read Ubuntu documentation on |
|
318 |
OpenSSL_ about creating one. |
|
319 |
||
320 |
.. _OpenSSL: https://help.ubuntu.com/community/OpenSSL#SSL_Certificates |
|
321 |
||
322 |
The ``mod_ssl`` module has to be enabled:: |
|
323 |
||
324 |
$ sudo a2enmod ssl |
|
325 |
||
326 |
When you get this working, you may want to redirect users that connect through |
|
327 |
regular HTTP to the secure site. Remove the ``ProxyPass`` for port 80 and |
|
328 |
replace it with a ``Redirect``:: |
|
329 |
||
330 |
<VirtualHost *:80> |
|
331 |
ServerName school1.example.org |
|
332 |
Redirect / https://school1.example.org/ |
|
1
by Gediminas Paulauskas
Import upstream version 1.6.0~a1 |
333 |
</VirtualHost> |
334 |
||
335 |
||
336 |
Copyright information |
|
337 |
--------------------- |
|
338 |
||
339 |
SchoolTool is copyright (c) 2003-2011 Shuttleworth Foundation |
|
340 |
||
341 |
All files in the src/schooltool directory are part of SchoolTool, and |
|
342 |
are (c) Shuttleworth Foundation, with the exception of translations in |
|
343 |
src/schooltool/locales, which are under the copyright of their |
|
344 |
original contributors via Launchpad at http://launchpad.net . |
|
345 |
||
346 |
Unless otherwise stated, files in src/schooltool are released under the |
|
347 |
terms of the GNU General Public License as published by the Free |
|
348 |
Software Foundation; either version 2 of the License, or (at your option) |
|
349 |
any later version. |
|
350 |
||
351 |
Files in the same directory as this README file are (c) Shuttleworth |
|
352 |
Foundation, with the exception of GPL, which is a copy of the Free Software |
|
353 |
Foundation's General Public License, and is (c) FSF. |
|
354 |
||
355 |
||
356 |
SchoolTool is distributed in the hope that it will be useful, |
|
357 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
358 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
359 |
GNU General Public License for more details. |
|
360 |
||
361 |
You should have received a copy of the GNU General Public License |
|
1.1.24
by Gediminas Paulauskas
Import upstream version 2.5.2.1 |
362 |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
1
by Gediminas Paulauskas
Import upstream version 1.6.0~a1 |
363 |
|
364 |
You can find the full copy of the GNU General Public License in a file called |
|
1.1.5
by Gediminas Paulauskas
Import upstream version 1.9.1 |
365 |
GPL.txt in the project directory. |