|
| 1 | +django-airports |
| 2 | +=============== |
| 3 | + |
| 4 | +.. image:: https://img.shields.io/pypi/v/django-airports.svg |
| 5 | + :target: https://pypi.python.org/pypi/django-airports/ |
| 6 | + |
| 7 | +.. image:: https://img.shields.io/pypi/dm/django-airports.svg |
| 8 | + :target: https://pypi.python.org/pypi/django-airports/ |
| 9 | + |
| 10 | +.. image:: https://img.shields.io/github/license/bashu/django-airports.svg |
| 11 | + :target: https://pypi.python.org/pypi/django-airports/ |
| 12 | + |
| 13 | +.. image:: https://app.travis-ci.com/bashu/django-airports.svg?branch=develop |
| 14 | + :target: https://app.travis-ci.com/bashu/django-airports |
| 15 | + |
| 16 | +Provides airports' related models and data (from `OurAirports <http://ourairports.org/>`_) that can be used in django projects, inspired by `django-cities <https://github.com/coderholic/django-cities>`_ |
| 17 | + |
| 18 | +Authored by `Basil Shubin <https://github.com/bashu>`_, and some great |
| 19 | +`contributors <https://github.com/bashu/django-airports/contributors>`_. |
| 20 | + |
| 21 | +.. image:: https://raw.githubusercontent.com/bashu/django-airports/develop/logo.png |
| 22 | + :target: https://raw.githubusercontent.com/bashu/django-airports/develop/logo.png |
| 23 | + :align: center |
| 24 | + :width: 600px |
| 25 | + |
| 26 | +Installation |
| 27 | +------------ |
| 28 | + |
| 29 | +First install the module, preferably in a virtual environment. It can be installed from PyPI: |
| 30 | + |
| 31 | +.. code-block:: shell |
| 32 | +
|
| 33 | + pip install django-airports |
| 34 | +
|
| 35 | +Requirements |
| 36 | +~~~~~~~~~~~~ |
| 37 | + |
| 38 | +You must have *django-cities* installed and configured, see the |
| 39 | +`django-cities <https://github.com/coderholic/django-cities>`_ documentation for details and setup instructions. |
| 40 | + |
| 41 | +Setup |
| 42 | +----- |
| 43 | + |
| 44 | +First make sure the database support spatial queries, see the `GeoDjango documentation <https://docs.djangoproject.com/en/dev/ref/contrib/gis/>`_ for details and setup instructions. |
| 45 | + |
| 46 | +You'll need to add ``airports`` to ``INSTALLED_APPS`` in your projects ``settings.py`` file: |
| 47 | + |
| 48 | +.. code-block:: python |
| 49 | +
|
| 50 | + INSTALLED_APPS += [ |
| 51 | + 'airports', |
| 52 | + ] |
| 53 | +
|
| 54 | +Then run ``./manage.py migrate`` to create the required database tables. |
| 55 | + |
| 56 | +Import data |
| 57 | +----------- |
| 58 | + |
| 59 | +After you have configured all settings, run |
| 60 | + |
| 61 | +.. code-block:: shell |
| 62 | +
|
| 63 | + python manage.py airports |
| 64 | +
|
| 65 | +The ``airports`` manage command has options, see ``airports --help`` output. |
| 66 | + |
| 67 | +Second run will update the DB with the latest data from the source csv file. |
| 68 | + |
| 69 | +Contributing |
| 70 | +------------ |
| 71 | + |
| 72 | +If you like this module, forked it, or would like to improve it, please let us know! |
| 73 | +Pull requests are welcome too. :-) |
| 74 | + |
| 75 | +License |
| 76 | +------- |
| 77 | + |
| 78 | +``django-airports`` is released under the MIT license. |
0 commit comments