Portail Internet pour les Activités Familiales
Go to file
François Poulain e78b3e97db feat(piaf): défini une date par défaut pour les objets TipiPaiement 2018-10-16 19:33:52 +02:00
piaf feat(piaf): défini une date par défaut pour les objets TipiPaiement 2018-10-16 19:33:52 +02:00
requirements ref(piaf): retire la dépendance eopayment; corrige des bugs de formulaire tipi 2018-09-21 11:54:06 +02:00
.gitignore Commit initial 2018-06-27 11:11:45 +02:00
.gitmessage doc(piaf): introduction d'un .gitmessage 2018-07-18 12:13:33 +02:00
CHANGELOG.md Commit initial 2018-06-27 11:11:45 +02:00
CONTRIBUTORS.txt Commit initial 2018-06-27 11:11:45 +02:00
LICENSE Commit initial 2018-06-27 11:11:45 +02:00
Makefile build(piaf): quand ça fail fast ça va plus vite à tester :) 2018-09-14 17:34:44 +02:00
README.md doc(piaf): précise l'installation des dépendances; testé sur une stretch neuve 2018-08-08 16:59:25 +02:00
config.env.example feat(piaf): ajoute une retriction d'IP sur la vue de collecte de paiement 2018-09-18 18:51:14 +02:00
manage.py style(piaf): passage sélectif de black ./piaf/ -l 80 -S 2018-08-29 19:22:13 +02:00
requirements.txt Commit initial 2018-06-27 11:11:45 +02:00
setup.cfg Commit initial 2018-06-27 11:11:45 +02:00



Portail Internet pour les Activités Familiales

Built with Cookiecutter Django



On a Debian-based host - running at least Debian Stretch, you will need the following packages:

  • python3
  • virtualenv
  • git
  • python3-crypto
  • python3-psycopg2 (optional, in case of a PostgreSQL database)

Note: if you're serving the application with uWSGI and NGINX on a sub location, ensure that you've added route-run = fixpathinfo: to your uWSGI configuration (from v2.0.11).

Using Makefile

It assumes that you have make installed on your computer. If not you can install it on Debian Stretch via the package make.

To prepare a virtualenv and install deps:

$ make init

That's it! You should now be able to start the Django development server to check that everything is working fine with:

$ make serve

Step by step

Note: you don't need this if you used Makefile.

It assumes that you have downloaded the last release of PIAF, extracted it and that you moved to that folder.

  1. Start by creating a new virtual environment under ./venv and activate it:

    $ virtualenv --system-site-packages ./venv -p /usr/bin/python3
    $ source ./venv/bin/activate
  2. Install the required Python packages depending on your environment:

    $ pip install -r requirements/production.txt
    ... or ...
    $ pip install -r requirements/development.txt
  3. Configure the application by setting the proper environment variables depending on your environment. You can use the config.env.example which give you the main variables with example values.

    $ cp config.env.example config.env
    $ nano config.env

    Note that this ./config.env file will be loaded by default when the application starts. If you don't want that, just move this file away or set the DJANGO_READ_CONFIG_FILE environment variable to false.

  4. Create the database tables - it assumes that you have created the database and set the proper configuration to use it:

    $ ./manage.py migrate

That's it! You should now be able to start the Django development server to check that everything is working fine with:

$ ./manage.py runserver



All the application files - e.g. Django code including settings, templates and statics - are located into the piaf/. It should permit in a near future to distribute the application as a Python package and install it system-wide.

Two environments are defined - either for requirements and settings:

  • development: for local application development and testing. It uses a SQLite3 database and enable debugging by default, add some useful settings and applications for development purpose - i.e. the django-debug-toolbar.
  • production: for production. It checks that configuration is set and correct, try to optimize performances and enforce some settings - i.e. HTTPS related ones.

Local changes

You can override and extend statics and templates locally. This can be useful if you have to change the logo for a specific instance for example. For that, just put your files under the local/static/ and local/templates/ folders.

Regarding the statics, do not forget to collect them after that. Note also that the local/ folder is ignored by git.

Variable content

All the variable content - e.g. user-uploaded media, collected statics - are stored inside the var/ folder. It is also ignored by git as it's specific to each application installation.

So, you will have to configure your Web server to serve the var/media/ and var/static/ folders, which should point to /media/ and /static/, respectively.


PIAF is developed by Cliss XXI and licensed under the AGPLv3+.