Vous voici sur le Git Rural du CRAW

README.md 2.72 KB
Newer Older
Patrick Houben's avatar
Patrick Houben committed
1
2
3
4
5
6
7
8
9
10
11
12
# TresoFerme - by [CRA-W](https://www.cra.wallonie.be/en)

TresoFerme, a simplified farm cash flow management tool, to help producers reappropriate their economic indicators and better manage their farms.


## Prerequisite
[Git](https://gitforwindows.org/) - 
[Python](https://www.python.org/downloads/) -
[Pipenv](https://pipenv.pypa.io/en/latest/install/)

## Installation

Patrick Houben's avatar
Patrick Houben committed
13
#### 1.  Clone repo and configure virtualenv
Patrick Houben's avatar
Patrick Houben committed
14
15
16
17
18
19
20
21
22

```bash
$ git clone git@gitrural.cra.wallonie.be:craw-app/tresoferme.git
$ cd tresoferme
$ pipenv install
$ pipenv shell
$ cd source # DO NOT FORGET!!!
```

Patrick Houben's avatar
Patrick Houben committed
23
#### 2. Check django install
Patrick Houben's avatar
Patrick Houben committed
24
25
26
27
28
29
```bash
(tresoferme) $ python -m django --version
# This should return django version number, 3 or upper, like 3.0.7
```


Patrick Houben's avatar
Patrick Houben committed
30
####  3. Check everything has been correctly installed
Patrick Houben's avatar
Patrick Houben committed
31
32
33
```bash
(tresoferme) $ python manage.py check
```
Patrick Houben's avatar
Patrick Houben committed
34
35
36
37
38
39
40
If you get the following error:
```bash
File "<install-dir>.local/share/virtualenvs/tresoferme-DMPJAftp/lib/python3.6/site-packages/easy_pdf/rendering.py", line 12, in <module>
    from django.utils.six import BytesIO
ModuleNotFoundError: No module named 'django.utils.six'
```
Error raised since [django3 features](https://github.com/nigma/django-easy-pdf/pull/73/files) is not yet integrated in latest version
Patrick Houben's avatar
Patrick Houben committed
41

Patrick Houben's avatar
Patrick Houben committed
42
43
44
45
46
47
48
49
50
51
52
Edit the file and change **Line 12**

```python
from django.utils.six import BytesIO
```

to

```python
from six import BytesIO
```
Patrick Houben's avatar
Patrick Houben committed
53

Patrick Houben's avatar
Patrick Houben committed
54
#### 4. run the shell source.accounts4sqlite.sh
Patrick Houben's avatar
Patrick Houben committed
55
56
57
```bash
(tresoferme) $ sh accounts4sqlite.sh
```
Patrick Houben's avatar
Patrick Houben committed
58
This shell is just changing profile foreign key from User to Profile in "source.accounts.models.py" file
Patrick Houben's avatar
Patrick Houben committed
59

Patrick Houben's avatar
Patrick Houben committed
60
#### 5. Launch localhost server
Patrick Houben's avatar
Patrick Houben committed
61
62
63
64
65
66
67
```bash
(tresoferme) $ python manage.py runserver
```

Load the site at http://127.0.0.1:8000


Patrick Houben's avatar
Patrick Houben committed
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#### 6. Connect using the following credentials:
usernames: admin, manager, demo, eleveur, maraicher

password: mybestpasswd

1. admin: allows to access django-admin and change key parameters in the database ie: django_site, money_unitlist, accounts_supportstructure, etc.

2. manager: allows you to manage you users: eleveur & maraicher. Go to top right menu and select 'Mes utilisateurs'

3. demo: simple test user

4. eleveur: stockbreeding example

5. maraicher: market gardening example


## Mailing from TresoFerme
If you want to use mailing from localhost (@SignIn for instance), you have to adapt EMAIL_HOST_USER and EMAIL_HOST_PASSWORD in settings_localhost.json file

```json
"EMAIL_HOST_USER": "hello@google.be",
"EMAIL_HOST_PASSWORD": "mybestpasswd",
```


Patrick Houben's avatar
Patrick Houben committed
93
94
95
96
97
98
99
100
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

## Acknowledgments
This project is heavily inspired by [wsvincent-djangoX](https://github.com/wsvincent/djangox).

## License
[MIT](https://choosealicense.com/licenses/mit/)