README.md 1.07 KB
Newer Older
Nicolas Joyard's avatar
Nicolas Joyard committed
1 2 3

## Prérequis

4
* Python 3 + headers (ie. python3-dev)
Nicolas Joyard's avatar
Nicolas Joyard committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
* virtualenvwrapper
* PostgreSQL

## Installation

```sh
$ git clone https://git.regardscitoyens.org/regardscitoyens/irfm.git
$ cd irfm
$ mkvirtualenv --python=$(which python3) irfm
$ pip install -e .
$ psql -c "create user irfm with password 'irfm';"
$ psql -c "create database irfm with owner irfm;"
$ irfm db upgrade
```

Nicolas Joyard's avatar
Nicolas Joyard committed
20 21 22 23 24 25 26
## Import des données

```sh
$ cd /path/to/irfm
$ workon irfm
$ irfm import_etapes
$ irfm import_nd
27
$ irfm import_adresses
Nicolas Joyard's avatar
Nicolas Joyard committed
28 29
```

30
## Mise à jour
Nicolas Joyard's avatar
Nicolas Joyard committed
31 32 33 34 35 36 37 38 39 40

```sh
$ cd /path/to/irfm
$ workon irfm
$ git pull
$ irfm db upgrade
```

## Développement

41 42 43 44 45 46 47 48 49 50 51 52
### Exécution locale

```bash
$ cd /path/to/irfm
$ workon irfm
$ export IRFM_CONFIG=irfm.config.EnvironmentConfig
$ export IRFM_DEBUG=True
$ export IRFM_DEBUG_SQL=True
$ export IRFM_DB_URL=postgresql://irfm:irfm@localhost:5432/irfm
$ irfm runserver
```

Nicolas Joyard's avatar
Nicolas Joyard committed
53 54 55 56 57 58 59 60 61 62 63 64 65 66
### Génération de migrations

Après avoir modifié les modèles Python :

```bash
$ irfm db migrate -m <description>
$ irfm db upgrade
```

### Création de migration vierge

```bash
$ irfm db revision -m <description>
```