Skip to content

Conversation

@brianhelba
Copy link
Collaborator

No description provided.

@brianhelba
Copy link
Collaborator Author

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)
Copy link
Collaborator Author

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.

Comment on lines 154 to 159
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)
Copy link
Collaborator Author

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()
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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?

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 19, 2025

Deploying geoinsight with  Cloudflare Pages  Cloudflare Pages

Latest commit: d60e7e6
Status: ✅  Deploy successful!
Preview URL: https://07e2f44d.geoinsight.pages.dev
Branch Preview URL: https://resonant-upgrade.geoinsight.pages.dev

View logs

# 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'
Copy link
Collaborator Author

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.

logging.getLogger('rasterio').setLevel(logging.ERROR)
logging.getLogger('large-image-converter').setLevel(logging.ERROR)

osgeo.gdal.SetConfigOption('OGR_GEOJSON_MAX_OBJ_SIZE', '500') # MB
Copy link
Collaborator Author

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:

I think the value is supposed to be like 500, not 500MB, but I wasn't able to test this.

Comment on lines +15 to +22
# 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')
Copy link
Collaborator Author

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).


[project]
name = "geoinsight"
version = "1.17.0"
Copy link
Collaborator Author

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]).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants