-
Notifications
You must be signed in to change notification settings - Fork 1
Upgrade to Resonant 0.41 #225
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?
Conversation
|
This is not at all ready, but I'm pushing so I can make comments about anything notable. |
| IGNORE_FILETYPES = ['dbf', 'sbn', 'sbx', 'cpg', 'shp.xml', 'shx', 'vrt', 'hdf', 'lyr'] | ||
|
|
||
|
|
||
| logging.getLogger('pyvips').setLevel(logging.ERROR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved this to the settings file, so it's guaranteed to run always and early.
geoinsight/settings/base.py
Outdated
| GEOINSIGHT_WEB_URL: str = env.url('DJANGO_GEOINSIGHT_WEB_URL').geturl() | ||
| GEOINSIGHT_ENABLE_TASK_FLOOD_SIMULATION: bool = env.bool('DJANGO_GEOINSIGHT_ENABLE_TASK_FLOOD_SIMULATION', default=True) | ||
| GEOINSIGHT_ENABLE_TASK_FLOOD_NETWORK_FAILURE: bool = env.bool('DJANGO_GEOINSIGHT_ENABLE_TASK_FLOOD_NETWORK_FAILURE', default=True) | ||
| GEOINSIGHT_ENABLE_TASK_NETWORK_RECOVERY: bool = env.bool('DJANGO_GEOINSIGHT_ENABLE_TASK_NETWORK_RECOVERY', default=True) | ||
| GEOINSIGHT_ENABLE_TASK_GEOAI_SEGMENTATION: bool = env.bool('DJANGO_GEOINSIGHT_ENABLE_TASK_GEOAI_SEGMENTATION', default=True) | ||
| GEOINSIGHT_ENABLE_TASK_TILE2NET_SEGMENTATION: bool = env.bool('DJANGO_GEOINSIGHT_ENABLE_TASK_TILE2NET_SEGMENTATION', default=True) | ||
| GEOINSIGHT_ENABLE_TASK_CREATE_ROAD_NETWORK: bool = env.bool('DJANGO_GEOINSIGHT_ENABLE_TASK_CREATE_ROAD_NETWORK', default=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I "namespaced" new Geoinsight-defined settings with GEOINSIGHT_.
| } | ||
| } | ||
|
|
||
| GEOINSIGHT_WEB_URL: str = env.url('DJANGO_GEOINSIGHT_WEB_URL').geturl() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a slightly more clear name than HOMEPAGE_REDIRECT_URL, but I'm open to feedback or to go back to the old name.
| 'hosts': [ | ||
| { | ||
| 'address': env.url('DJANGO_REDIS_URL').geturl(), | ||
| # Use /1 for channels backend, as /0 is used by celery |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't clear on this. Is the /0 Redis database actually being used anywhere?
a00f1d5 to
bb34c9d
Compare
Deploying geoinsight with
|
| Latest commit: |
d60e7e6
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://07e2f44d.geoinsight.pages.dev |
| Branch Preview URL: | https://resonant-upgrade.geoinsight.pages.dev |
| # Make Django and Allauth redirects consistent, but both may be changed. | ||
| LOGIN_REDIRECT_URL = '/' | ||
| ACCOUNT_LOGOUT_REDIRECT_URL = '/' | ||
| ACCOUNT_SIGNUP_FORM_CLASS = 'resonant_utils.allauth.FullNameSignupForm' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, this is already provided in an upstream Resonant repo, so I was able to delete the local AccountSignupForm.
Also, using ACCOUNT_SIGNUP_FORM_CLASS seems to be slightly preferable to ACCOUNT_FORMS = {'signup': ..., per https://docs.allauth.org/en/dev/headless/faq.html . That's what the upstream class is designed for too.
geoinsight/settings/base.py
Outdated
| logging.getLogger('rasterio').setLevel(logging.ERROR) | ||
| logging.getLogger('large-image-converter').setLevel(logging.ERROR) | ||
|
|
||
| osgeo.gdal.SetConfigOption('OGR_GEOJSON_MAX_OBJ_SIZE', '500') # MB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set this early and globally here, so we don't need to set it in the external runtime environment.
See:
- https://gdal.org/en/stable/drivers/vector/geojson.html#configuration-options
- https://gdal.org/en/stable/api/python/general.html#osgeo.gdal.SetConfigOption
I think the value is supposed to be like 500, not 500MB, but I wasn't able to test this.
| # Force WhiteNoice to serve static files, even when using 'manage.py runserver_plus'; | ||
| # Force Daphne to provide an ASGI "runserver" command; | ||
| # WhiteNoice's override is smart enough to dispatch to any successor INSTALLED_APPS commands, | ||
| # so place it first; | ||
| # The order should be ['whitenoise', 'daphne', 'django...staticfiles'] | ||
| staticfiles_index = INSTALLED_APPS.index('django.contrib.staticfiles') | ||
| INSTALLED_APPS.insert(staticfiles_index, 'daphne') | ||
| INSTALLED_APPS.insert(staticfiles_index, 'whitenoise.runserver_nostatic') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit tricky, since both daphne and whitenoise.runserver_nostatic are competing to override the runserver command, but only whitenoise is smart enough to respect the other overrides (based on looking at the source code).
bb34c9d to
edf7cec
Compare
|
|
||
| [project] | ||
| name = "geoinsight" | ||
| version = "1.17.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this actually being used anywhere? Since a Django project isn't actually redistributable via PyPI, we normally just set this to 0.0.0 (since it's a required key in [project]).
edf7cec to
d60e7e6
Compare
No description provided.