README.md 3.17 KB
Newer Older
1
2
Debian NM Front Desk web application
====================================
Enrico Zini's avatar
Enrico Zini committed
3

Enrico Zini's avatar
Enrico Zini committed
4
5
WARNING: project moved to https://salsa.debian.org/nm-team/nm.debian.org

6
7
## Running this code on your own machine
### Dependencies
8

9
See `.gitlab-ci.yml` for an up to date list of dependencies.
Gianfranco Costamagna's avatar
Gianfranco Costamagna committed
10

11
### Configuration
Enrico Zini's avatar
Enrico Zini committed
12

13
    mkdir data # required by default settings
14
    cd nm2
Enrico Zini's avatar
Enrico Zini committed
15
16
    ln -s local_settings.py.devel local_settings.py
    edit local_settings.py as needed
Enrico Zini's avatar
Enrico Zini committed
17

18
19
### First setup
    
Gianfranco Costamagna's avatar
Gianfranco Costamagna committed
20
    ./manage.py migrate
Enrico Zini's avatar
Enrico Zini committed
21

22
### Fill in data
23
Visit https://nm.debian.org/am/db-export to download nm-mock.json; for privacy,
Enrico Zini's avatar
Enrico Zini committed
24
25
26
27
28
sensitive information are replaced with mock strings.

If you cannot login to the site, you can ask any DD to download it for you.
There is nothing secret in the file, but I am afraid of giving out convenient
email databases to anyone.
Enrico Zini's avatar
Enrico Zini committed
29

30
    ./manage.py import nm-mock.json
Enrico Zini's avatar
Enrico Zini committed
31

32
33
34
35
If you are a Front Desk member or a DAM and want a full database export, you
need to use

    ./manage.py export --full
Enrico Zini's avatar
Enrico Zini committed
36

urbec's avatar
urbec committed
37
38
39
40
41
### Reset database
    rm data/db-used-for-development.sqlite
    ./manage.py migrate
    ./manage.py import nm-mock.json

42
43
### Run database maintenance
    
44
    ./manage.py housekeeping
Enrico Zini's avatar
Enrico Zini committed
45

46
47
48
### Run the web server
    
    ./manage.py runserver
Enrico Zini's avatar
Enrico Zini committed
49
50


51
## Periodic updates
52
You need to run periodic maintenance to check/regenerate the de-normalised
Enrico Zini's avatar
Enrico Zini committed
53
54
fields:

55
    ./manage.py housekeeping
Enrico Zini's avatar
Enrico Zini committed
56
57


58
## Development
Enrico Zini's avatar
Enrico Zini committed
59
Development targets Django 1.8, although the codebase has been created with
Enrico Zini's avatar
Enrico Zini committed
60
Django 1.2 and it still shows in some places. Feel free to cleanup.
Enrico Zini's avatar
Enrico Zini committed
61
62
63
64
65
66
67
68
69
70
71
72

Unusual things in the design:

* `backend/` has the core models. Note that `backend.models.Process` is the
  old-style workflow, and `process.model.Process` is the new style workflow.
* there is a custom permission system with a class hierarchy that starts at
  `backend.models.VisitorPermissions`, and that generates a set of permission
  strings that get tested in views and templates with things like `if
  "edit_bio" in visit_perms: …`.
* `backend.mixins.VisitorMixin` is the root of a class hierarchy of mixins used
  by most views in the site; those mixins implement the basis of resource
  instantiation and permission checking.
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101

## WebUI Translation
The NM Front Desk web application is supporting localization's due the
possibility of build in l10n support. Currently there are the languages German,
French, Spanish and Italian prepared. You might want to help out to improve the
existing l10n strings or add more languages. To do this you will need the
following steps.

Updating the current strings of the language you want to work on. E.g. for
German. (Note: If you don't use a single language as specification all
languages will be updated.)

    ./manage.py makemessages -l de

Next simply use the preferred tool for working on the .po file which can be
found in the folder `locale/$(LANG)/LC_MESSAGES/django.po`.

To test your work you need to create the compiled catalog of the l10n strings.

    ./manage.py compilemessages

Next run the local Django webserver.

    ./manage.py runserver

Control your work with the preferred browser by calling the URI
'localhost:8000'. Note, you need to call `./manage.py compilemessages` again
once you have modified the *.po file in order to improve the preferred
translation.