FFDN ISP Database

pitchum ab7eccdabc Return HTTP status 405 instead of 500 + stacktrace + email. 5 years ago
ffdnispdb ab7eccdabc Return HTTP status 405 instead of 500 + stacktrace + email. 5 years ago
.gitignore e0b442a607 Add vim swp files to the list of ignored files 10 years ago
AUTHORS 6ecced052a [mod] Update Gu1 email, and fork github deps on code.f.o (refs adminsys email) 7 years ago
LICENSE 6871cede74 Add a 3-clause BSD License in the LICENSE file 10 years ago
README.md ab57756b95 Fix libspatialite.so: undefined symbol: sqlite3_spatialite_init 6 years ago
TODO ba6088526a Update TODO list with a proposal from julienth37 9 years ago
app_prod.py ab6fece2f9 Add an app file to use in production 10 years ago
babel.cfg 8bbdd2c9f7 Implement javascript i18n using a jinja tempate, add Flask-Cache for caching 10 years ago
manage.py cc26ab6296 Fix manage db create and runserver 10 years ago
requirements.txt f55ecd8f24 Fix requests version in requirements 6 years ago
settings_dev.py 44978d076d Switch to the Application Factory pattern and Blueprints 10 years ago
settings_prod.py.dist 90bcb4d1b9 Update TODO, cosmetic changes to the map, add an empty API page 10 years ago
test_ffdnispdb.py ab6fece2f9 Add an app file to use in production 10 years ago
variables.less 2c57a65651 Add a search input in navbar and a hover effect on nav buttons 10 years ago

README.md

ffdnispdb

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

How to install

ffdnispdb requires python2.

Third-party dependencies:

  • sqlite
  • libspatialite
  • build-essential
  • python-dev

On a Debian Jessie system, do:

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

On a Debian Stretch system, do:

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

Preferably in a virtualenv, run:

pip install -r requirements.txt
python manage.py db create

Develop deployement

To start the development server, run:

python manage.py runserver

Production deployment

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.

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.

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

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

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

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