-
Notifications
You must be signed in to change notification settings - Fork 2
Add geocrud #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add geocrud #14
Changes from 9 commits
f145c10
442fee2
1fb9d49
1845a7a
93c2387
96e9fad
11753d7
9206751
aab7bb5
a0a1495
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from django.conf import settings | ||
from django.contrib import admin | ||
from geostore import models as geostore_models | ||
from mapbox_baselayer.admin import MapBaseLayerAdmin | ||
from mapbox_baselayer.models import MapBaseLayer | ||
|
||
if settings.USE_TERRAGEOCRUD: | ||
from terra_geocrud import models as geocrud_models, admin as geocrud_admin | ||
admin.site.register(geocrud_models.CrudGroupView, geocrud_admin.CrudGroupViewAdmin) | ||
admin.site.register(geocrud_models.CrudView, geocrud_admin.CrudViewAdmin) | ||
admin.site.register(geocrud_models.AttachmentCategory, geocrud_admin.AttachmentCategoryAdmin) | ||
admin.site.register(geostore_models.Layer, geocrud_admin.CrudLayerAdmin) | ||
jrmi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
admin.site.register(geostore_models.Feature, geocrud_admin.CrudFeatureAdmin) | ||
admin.site.register(MapBaseLayer, MapBaseLayerAdmin) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env python | ||
#!/code/venv/bin/python | ||
import os | ||
import sys | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,8 @@ | |
|
||
USE_TZ = True | ||
|
||
USE_TERRAGEOCRUD = os.environ.get('TERRAGEOCRUD', False) | ||
|
||
INSTALLED_APPS = ( | ||
'terra_utils', | ||
'django.contrib.auth', | ||
|
@@ -36,9 +38,20 @@ | |
'geostore', | ||
'django_geosource', | ||
'terra_layer', | ||
'mapbox_baselayer', | ||
'django.contrib.admin', | ||
'django.contrib.messages', | ||
'custom.dataloader', | ||
'django_json_widget', | ||
'reversion', | ||
'sorl.thumbnail', | ||
|
||
) | ||
|
||
if USE_TERRAGEOCRUD: | ||
INSTALLED_APPS += ('terra_geocrud', | ||
'django_object_actions', | ||
'template_model') | ||
|
||
AUTH_USER_MODEL = 'terra_accounts.TerraUser' | ||
|
||
PROJECT_DIR = os.path.abspath('.') | ||
|
@@ -53,6 +66,7 @@ | |
JWT_AUTH = { | ||
'JWT_EXPIRATION_DELTA': timedelta(hours=1), | ||
'JWT_ALLOW_REFRESH': True, | ||
'JWT_PAYLOAD_HANDLER': 'terra_accounts.jwt_payload.terra_payload_handler', | ||
} | ||
|
||
TOKEN_TIMEOUT = 3600 | ||
|
@@ -179,11 +193,11 @@ | |
|
||
TILE_FLAVOR = 'smart' | ||
|
||
MIN_TILE_ZOOM = 7 | ||
MIN_TILE_ZOOM = 2 | ||
MAX_TILE_ZOOM = 16 | ||
INTERNAL_GEOMETRY_SRID = 4326 | ||
|
||
TERRA_TILES_HOSTNAMES = [] | ||
|
||
# let DEBUG & CORS be overridable in prod | ||
DEBUG = False | ||
CORS_ORIGIN_ALLOW_ALL = False |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,3 +34,17 @@ TERRA_APPLIANCE_SETTINGS = { | |
'enabled_modules': ['User', 'DataSource', 'DataLayer'], # Enabled terra admin modules | ||
} | ||
|
||
## Uncoment these lines to enable and configure geocrud and add 'CRUD' above in enabled_modules | ||
# TERRA_GEOCRUD = { | ||
# 'EXTENT': [2, 40, 6, 50], | ||
# 'MBGLRENDERER_URL': os.getenv('MBGLRENDERER_URL', 'http://mbglrenderer'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. mbgl renderer is not added to the docker-compose stack ? |
||
# "map": { | ||
# "mapbox_access_token": "key_mapbox", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not auto loaded from environment ? |
||
# "center": [3, 46], | ||
# "zoom": 5, | ||
# "maxZoom": 17, | ||
# "minZoom": 3 | ||
# }, | ||
# "MAX_ZOOM": 17, | ||
# } | ||
# |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,14 +14,20 @@ | |
2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) | ||
""" | ||
from django.conf import settings | ||
from django.contrib import admin | ||
from django.conf.urls.static import static | ||
from django.urls import include, path | ||
|
||
from custom.receivers import * # noqa | ||
|
||
urlpatterns = [ | ||
path('', admin.site.urls), | ||
path('api/', include('terra_layer.urls')), | ||
path('api/mapbox_baselayer/', include('mapbox_baselayer.urls')), | ||
] | ||
|
||
if settings.DEBUG and False: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and False ???? |
||
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) | ||
|
||
if settings.USE_TERRAGEOCRUD: | ||
urlpatterns += [path('api/crud/', include('terra_geocrud.urls'))] |
Uh oh!
There was an error while loading. Please reload this page.