README.md 2.25 KB
Newer Older
Gu1's avatar
Gu1 committed
1 2 3 4 5 6
ffdnispdb
=========

``ffdnispdb`` is a website designed to display all the ISPs implementing the
``ispschema`` specification.

7
## How to install
8 9 10

``ffdnispdb`` requires python2.

11 12 13
Third-party dependencies:
 * ``sqlite``
 * ``libspatialite``
14 15
 * ``build-essential``
 * ``python-dev``
16

17 18
On a Debian Jessie system, do:

19
    apt install sqlite3 libspatialite-dev build-essential python-dev
20

21 22 23 24
On a Debian Stretch system, do:

    apt install sqlite3 libsqlite3-mod-spatialite build-essential python-dev

Gu1's avatar
Gu1 committed
25 26
Preferably in a virtualenv, run:

27
    pip install -r requirements.txt
Gu1's avatar
Gu1 committed
28
    python manage.py db create
29

30
### Develop deployement
31 32
To start the development server, run:

Gu1's avatar
Gu1 committed
33
    python manage.py runserver
Gu1's avatar
Gu1 committed
34

35
### Production deployment
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
To deploy this application, we recommend the use of gunicorn/gevent.
We strongly discourage you to use a synchronous WSGI server, since the app uses
``Server-sent events``.

First, copy the example settings file:

    cp settings_prod.py.dist settings_prod.py

Then, edit the newly created ``settings_prod.py``:
generate a random ``SECRET_KEY``, add yourself to the ``ADMINS`` array.
To see the full list of available settings, see the ``ffdnispdb/default_settings.py`` file
and [Flask's documentation](http://flask.pocoo.org/docs/config/#builtin-configuration-values).

Now, you can run gunicorn using the ``app_prod.py`` file, which logs warnings
to an application.log file and send you errors by email.

    gunicorn -k gevent -b 127.0.0.1:8080 --log-level warning app_prod:app

You can also edit ``app_prod.py`` to customize logging behavior.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70

## How to translate
First, generate the template:

    pybabel extract -F babel.cfg -o messages.pot ffdnispdb

Then initialize the catalog for the language you want:

    pybabel init -i messages.pot -d ffdnispdb/translations -l XX

(where XX is the language code)

Once you're done translating, run:

    pybabel compile -d ffdnispdb/translations

71 72
Now, you can add your language to the ``LANGUAGES`` dict in ``ffdnispdb/default_settings.py``.

73 74 75 76 77
To update the catalog with the latest strings:

    pybabel extract -F babel.cfg -o messages.pot ffdnispdb
    pybabel update -i messages.pot -d ffdnispdb/translations

78 79
Once you've tested your work and you're satisfied with the result, you can
send us a patch (or the po file directly).