Metadata-Version: 2.4
Name: django-dh-map
Version: 0.2.0
Summary: A Django app meant to help build out Digital Humanities (DH) mapping projects quickly. This is a very opinionated package that is primarily meant for in-house use only but others might find it useful as a starting point
Author-email: Andrew Gardener <andrew_gardener@sfu.ca>
License-Expression: GPL-3.0-or-later
Project-URL: Homepage, https://github.com/sfu-dhil/django-dh-map
Project-URL: Source, https://github.com/sfu-dhil/django-dh-map
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 6.0
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Requires-Python: >=3.14
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Django>=6.0.3
Requires-Dist: django-polymorphic>=4.11.2
Requires-Dist: django-nested-admin
Requires-Dist: django-jsonform>=2.23.2
Requires-Dist: django-admin-interface>=0.32.0
Requires-Dist: django-solo>=2.5.1
Requires-Dist: django-tinymce>=5.0.0
Requires-Dist: django-imagekit>=6.1.0
Requires-Dist: django-ffield>=0.0.9
Requires-Dist: python-magic>=0.4.27
Requires-Dist: django-async-upload-kg>=4.0.5
Requires-Dist: django-js-asset>=3.1.2
Requires-Dist: djangorestframework>=3.17.1
Requires-Dist: djangorestframework-gis>=1.2.1
Requires-Dist: django-admin-sortable2>=2.3.1
Requires-Dist: django-rq>=3.2.2
Requires-Dist: redis>=7.4.0
Requires-Dist: pillow>=12.1.1
Requires-Dist: numpy>=2.4.4
Requires-Dist: py360convert>=1.0.4
Requires-Dist: natsort>=8.4.0
Requires-Dist: psycopg[binary]
Provides-Extra: django-health-check
Requires-Dist: django-health-check>=3.20.8; extra == "django-health-check"
Provides-Extra: django-cleanup
Requires-Dist: django-cleanup>=9.0.0; extra == "django-cleanup"
Provides-Extra: django-cache-cleaner
Requires-Dist: django-cache-cleaner>=0.2.0; extra == "django-cache-cleaner"
Provides-Extra: django-vite
Requires-Dist: django-vite>=3.1.0; extra == "django-vite"
Dynamic: license-file

This is an package mainly for in-house usage. There are a lot of admin packages used that might not work well in your environment (ex: `django-rq` instead of `celery` for background jobs). Its primary goal is to help springboard new Digital Humanities mapping projects with a decent amount of flexability.

If you cannot directly use this package, consider forking and customizing for your own usage/environment or just use it for inspiration.

## Requirements

- `gdal`, `gdal-tools` for postgis and overhead tile generation
- `ffmpeg` for video resolution and thumbnail generation
- `libmagic` for image processing
- `redis` for background job support
- Assumes `postgres` database with gis (`postgis`)

## Install

Add all the deps (including `django_dh_map`) to your `INSTALLED_APPS`

```python
INSTALLED_APPS = [
    ...,
    'django_dh_map',
    'admin_interface',
    'colorfield',
    'nested_admin',
    'django_jsonform',
    'adminsortable2',
    'solo',
    'tinymce',
    'admin_async_upload',
    'imagekit',
    'django_rq',
    'django.contrib.gis',
    'django.contrib.postgres',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'polymorphic',
    'rest_framework',
    'rest_framework_gis',
    ...,
]
```

Add the urls to your project


```python
urlpatterns = [
    ...,
    # django-async-upload endpoints
    path('admin_async_upload/', include('admin_async_upload.urls')),
    # tinymce endpoints
    path('tinymce/', include('tinymce.urls')),
    # django_rq admin endpoints
    path('django-rq/', include('django_rq.urls')),
    # django_dh_map endpoints
    path('', include("django_dh_map.urls")),
    ...,
]
```

Run `python manage.py migrate`

Include the package javascript and css into your `base.html` file's head section

```html
{% load static %}
...
<head>
    ...
    <link rel="stylesheet" href="{% static 'django_dh_map/dist/django_dh_map.css' %}">
    <script src="{% static 'django_dh_map/dist/django_dh_map.js' %}" defer></script>
    ...
</head>
```

## Example Project

See [example/README.md](https://github.com/sfu-dhil/django-dh-map/blob/main/example/README.md) for instructions for running the example app (using Docker). Run the `docker compose` commands from the root directory.

## Development

### Build assets

    # install node_modules
    docker run --rm -it -v $PWD:/app/ -w /app/vite node:25.5 yarn

    # build assets
    docker run --rm -it -v $PWD:/app/ -w /app/vite node:25.5 yarn build

    # build assets and watch for changes
    docker run --rm -it -v $PWD:/app/ -w /app/vite node:25.5 yarn watch
    docker run --rm -it -v $PWD:/app/ -w /app/vite node:25.5 yarn watch_dist

<!--
### Manually update Bootstrap/Fontawesome icon selector

    docker run --rm -it -v $PWD:/app/ -w /app/vite node:25.5 yarn
    docker run --rm -it -v $PWD:/app/ -w /app python:3.14-alpine python scripts/get_bootstrap_icons_choices.py

./:/app/django_dh_map

    # build assets and watch for changes
    docker run --rm -it -v $PWD:/app/ -w /app/vite node:25.5 yarn watch -->
