README.md 1.13 KB
Newer Older
1
## Installation
Nicolas Joyard's avatar
Nicolas Joyard committed
2

3
### Prérequis
Nicolas Joyard's avatar
Nicolas Joyard committed
4

5
* Python 3 + headers (ie. python3-dev)
Nicolas Joyard's avatar
Nicolas Joyard committed
6 7 8
* virtualenvwrapper
* PostgreSQL

9
### Nouvelle Installation
Nicolas Joyard's avatar
Nicolas Joyard committed
10 11 12 13 14 15 16 17 18

```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
19 20
$ irfm import_etapes
$ irfm import_nd
21
$ irfm import_adresses
Nicolas Joyard's avatar
Nicolas Joyard committed
22 23
```

24
### Mise à jour
Nicolas Joyard's avatar
Nicolas Joyard committed
25 26 27 28 29

```sh
$ cd /path/to/irfm
$ workon irfm
$ git pull
30
$ pip install -e .
Nicolas Joyard's avatar
Nicolas Joyard committed
31
$ irfm db upgrade
32 33 34
$ irfm import_etapes
$ irfm import_nd
$ irfm import_adresses
35
$ irfm clear_cache
Nicolas Joyard's avatar
Nicolas Joyard committed
36 37 38 39
```

## Développement

40 41 42 43 44 45 46 47 48 49 50 51
### 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
52 53 54 55 56 57 58 59 60 61 62 63 64 65
### 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>
```