PolyBookExchange is a small django application used for book exchange at AGEPoly, the student association of EPFL.
PolyBookExchange is distributed with the BSD license.
PolyBookExchange has been developped by Maximilien Cuony .
This version is adapted from a previous django version made in 2010, who was made from the original version, developped in Java (in 2007?), by Loïc Etienne et Aristidis Papaioannou.
The module can be used in any django 4 project in python, but some additionnal work may be needed:
- The system assume all users have a
get_sciper()
method, returing an unique ID for the current user. The system will use the EPFL's LDAP and the sciper to make queries for user's details. If the method does not exist, the username is assumed to be the sciper
pip install https://github.com/PolyLAN/polybookexchange.git
You need to activate this app, and django.contrib.humanize.
Add to your INSTALLED_APPS:
'polybookexchange',
'django.contrib.humanize',
(Of course, you don't need to add a line twice if one app is already installed !)
Add to your settings.py
POLYBOOKEXCHANGE_EMAIL_FROM = ''
POLYBOOKEXCHANGE_EMAIL_MANAGERS = ''
and update values as you need. The first one is the sender for all email send by the book exchange and the second one is the email of someone who should be alerted e.g. when the price of a book change.
Add something like this:
url(r'^books/', include('polybookexchange.urls')),
python manage.py migrate
python manage.py loaddata polybookexchange_epfl.yaml
The code is formatted using black and isort. You can install the tools with
pip install black isort
You can run the formating by running
$ black
$ isort
To run the formatters in the pre-commit hook, install pre-commit (pip install pre-commit
) and run $ pre-commit install
at the root of the repository