Skip to main content

A Django package for countries and cities with translations.

Project description

GeoBank

A Django package that provides models for Countries and Cities with translation support using django-modeltranslation.

Installation

  1. Install the package:

    pip install GeoBank
    
  2. Add geobank and modeltranslation to your INSTALLED_APPS in settings.py. Note: modeltranslation must be added before django.contrib.admin.

    INSTALLED_APPS = [
        'modeltranslation',
        'django.contrib.admin',
        # ...
        'geobank',
    ]
    
  3. Configure your languages in settings.py:

    LANGUAGES = (
        ('en', 'English'),
        ('fa', 'Persian'),
        # ... other languages
    )
    
  4. Run migrations:

    python manage.py makemigrations
    python manage.py migrate
    
  5. Populate the database:

    python manage.py populate_geobank
    

    To run in the background (requires Celery):

    python manage.py populate_geobank --background
    

    To choose the cities population:

    python manage.py populate_geobank --population-gte {500, 1000, 5000, 15000}
    

Requirements

  • Django >= 3.2
  • django-modeltranslation >= 0.18.0
  • Pillow >= 9.0
  • Celery (optional, for background tasks)
  • tqdm (for progress bars)
  • requests

TODO

  • Improve data gathering and population faster using async scrips
  • Add more fields to models

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geobank-0.4.0.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geobank-0.4.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file geobank-0.4.0.tar.gz.

File metadata

  • Download URL: geobank-0.4.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for geobank-0.4.0.tar.gz
Algorithm Hash digest
SHA256 c3948b444503ecb6ed49d77b608312a278a603f0d60322024859aa796d1f5dd9
MD5 559f388b72ba227e9cfef7bafc91a24f
BLAKE2b-256 93871d4fd5dbfb773277d30418ae86a3fd21861540cc4cf2af24745ebf6d3ff1

See more details on using hashes here.

File details

Details for the file geobank-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: geobank-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for geobank-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0dcff39f2844d40fe678f94fcb7066be029a2ae356f8be2106b8d05d00d852b9
MD5 226ef0dd6ace4b89ff96db05e07a6f17
BLAKE2b-256 6e43dea05b96e39d13db6779812586dfd0992865428bd7d28d1d6ada59b16b3d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page