Personal fork from https://anonscm.debian.org/git/nm/nm2.git
Enrico Zini e6c774c725 Notify log entries to nm@debian.org | 8 年 前 | |
---|---|---|
api | 8 年 前 | |
apikeys | 8 年 前 | |
backend | 8 年 前 | |
contributors | 10 年 前 | |
deblayout | 8 年 前 | |
dm | 8 年 前 | |
dsa | 8 年 前 | |
fprs | 8 年 前 | |
keyring | 8 年 前 | |
locale | 11 年 前 | |
maintenance | 10 年 前 | |
minechangelogs | 8 年 前 | |
nm2 | 8 年 前 | |
nmlayout | 8 年 前 | |
person | 8 年 前 | |
process | 8 年 前 | |
projectb | 8 年 前 | |
public | 8 年 前 | |
restricted | 8 年 前 | |
templates | 8 年 前 | |
test_data | 8 年 前 | |
wizard | 8 年 前 | |
.coveragerc | 8 年 前 | |
.gitignore | 8 年 前 | |
LICENSE | 9 年 前 | |
README.md | 8 年 前 | |
TODO | 11 年 前 | |
archive-process-email | 8 年 前 | |
coverage.sh | 8 年 前 | |
debsso | 8 年 前 | |
fabfile.py | 10 年 前 | |
manage.py | 10 年 前 | |
test-archive-process-email | 9 年 前 | |
urls.py | 8 年 前 |
apt-get install python-markdown python-ldap python-psycopg2 python-xapian \
python-django python-django-south python-django-housekeeping \
python-debian python-debiancontributors
The ‘python-django-housekeeping’ package is not available in Debian earlier than Debian Stretch. If you are deploying to a machine running Debian earlier than Stretch, use the following procedure:
# https://github.com/spanezz/django-housekeeping
git clone https://github.com/spanezz/django-housekeeping
(you can either build the package from it or symlink the module directory
into the contributors.debian.org sources)
# build the package
fakeroot debian/rules clean binary
# install the package
dpkg -i ../python-django-housekeeping_0.1-1_all.deb
mkdir data # required by default settings
cd nm2
ln -s local_settings.py.devel local_settings.py
edit local_settings.py as needed
./manage.py migrate
Visit https://nm.debian.org/am/db-export to download nm-mock.json; for privacy, 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.
./manage.py import nm-mock.json
If you are a Front Desk member or a DAM, you can use https://nm.debian.org/am/db-export?full for a full database export.
rsync -az --progress keyring.debian.org::keyrings/keyrings/ ./data/keyrings/
./manage.py housekeeping
./manage.py runserver
You need to run periodic maintenance to check/regenerate the denormalised fields:
./manage.py housekeeping
Development targets Django 1.8, although the codebase has been created with Django 1.2 and it still shows in some places. Feel free to cleanup.
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.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.