README.md 2.44 KB
Newer Older
1
2
3
[![pipeline status](https://gitlab.gnome.org/Infrastructure/damned-lies/badges/master/pipeline.svg)](https://gitlab.gnome.org/Infrastructure/damned-lies/-/commits/master)
[![coverage report](https://gitlab.gnome.org/Infrastructure/damned-lies/badges/master/coverage.svg)](https://gitlab.gnome.org/Infrastructure/damned-lies/-/commits/master)

4
5
# `damned-lies`

6
7
`damned-lies` is a **translation-tracking Web application** originally aimed to help the GNOME Translation project. It
is written in Python and is based on the [Django](https://www.djangoproject.com) framework.
8
9
10

You can find the Data model in the `/docs` directory.

11
## Contribute and install
12

13
14
Please, refer to the [Contribution guide](CONTRIBUTING.md) in order to know how to install `damned-lies` in a
development environment.
15

16
<!-- This should be moved to a documentation instead of remaining in the README file -->
17
18
19
20

## Maintenance tasks

There is a management command to run maintenance tasks (clean never-activated accounts, inactivate unused roles, …):
21

22
23
24
```bash
./manage.py run-maintenance
```
25

26
27
Note: it might be useful to add the command in a cron schedule.

28
29
<!-- This should be moved to a documentation instead of remaining in the README file -->

30
31
32
33
34
35
## Databases

It’s important to use the Unix Domain Socket connection to obtain good performances.

### PostgreSQL

36
37
In the `DATABASES['default']` dictionary, you just need to define `ENGINE = 'django.db.backends.postgresql'`
and the `NAME` key. Leave the `HOST` setting empty to use `UDS`.
38
39
40

### MySQL

41
42
Create a database in UTF8, either with `default-character-set = utf8` under `[mysqld]` section in the `my.cnf` file or
with an explicit SQL instruction:
43
44

```sql
45
46
CREATE
DATABASE <DATABASE_NAME> charset=utf8;
47
48
49
50
51
52
```

Then, you have to update your `damnedlies/local_settings.py`:

```python
DATABASES = {
53
    'default': {
54
55
56
57
        'ENGINE': 'django.db.backends.mysql',
        'NAME': '<your database name>',
        'USER': '<your user>',
        'PASSWORD': '<your password>',
58
59
        'HOST': '/var/run/mysqld/mysqld.sock',
        'OPTIONS': {
60
61
62
63
64
65
            'read_default_file': '/etc/mysql/my.cnf',
        }
    }
}
```

66
67
68
69
Grep for `ANSI_QUOTES` in the source code to find the `models.py` which use a hack to workaround the double quotes
interpretation in MySQL. The best solution is to run the MySQL server with
the [`ANSI_QUOTES` mode](http://dev.mysql.com/doc/refman/5.7/en/sql-mode.html) (`sql-mode="ANSI_QUOTES"` in `my.cnf`),
but it can be damaging for other applications.