Skip to content

Commit b15fe5d

Browse files
committed
Add admin interface to README
1 parent 022fbe2 commit b15fe5d

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

README.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,11 @@ Support for general FileFeild's or File URLs
5757
- Supports GDAL's [Virtual File System](https://gdal.org/user/virtual_file_systems.html) for `s3://`, `ftp://`, etc. URLs
5858

5959
Miscellaneous:
60-
- caching - tile sources are cached for rapid file re-opening
60+
- Admin interface widget for viewing image tiles.
61+
- Caching - tile sources are cached for rapid file re-opening
6162
- tiles and thumbnails are cached to prevent recreating these data on multiple requests
6263
- Easily extensible SSR templates for tile viewing with CesiumJS and GeoJS
63-
- OpenAPI documentation in swagger
64+
- OpenAPI specification
6465

6566
## Installation
6667

@@ -170,14 +171,35 @@ from example.core.viewsets import ImageFileDetailView
170171
from rest_framework.routers import SimpleRouter
171172

172173
router = SimpleRouter(trailing_slash=False)
173-
router.register(r'api/large-image', ImageFileDetailView, basename='image-file')
174+
router.register(r'api/image-file', ImageFileDetailView, basename='image-file')
174175

175176
urlpatterns = [
176177
path('', include('django_large_image.urls')), # Some additional diagnostic URLs from django-large-image
177178
] + router.urls
178179

179180
```
180181

182+
You can also opt into an admin widget for you model:
183+
184+
```html
185+
templates/admin/myapp/imagefile/change_form.html
186+
---
187+
{% extends "admin/change_form.html" %}
188+
189+
{% block after_field_sets %}
190+
191+
<script>
192+
var baseEndpoint = 'api/image-file';
193+
</script>
194+
195+
{% include 'admin/django_large_image/_include/geojs.html' %}
196+
197+
{% endblock %}
198+
```
199+
200+
![admin-interface](https://raw.githubusercontent.com/ResonantGeoData/django-large-image/main/doc/admin.png)
201+
202+
181203
Please note the example Django project in the `project/` directory of this
182204
repository that shows how to use `django-large-image`.
183205

doc/admin.png

853 KB
Loading

0 commit comments

Comments
 (0)