-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial migration commit: Add readme
- Loading branch information
Showing
3 changed files
with
161 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# Created by .ignore support plugin (hsz.mobi) | ||
### Python template | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*,cover | ||
.hypothesis/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# IPython Notebook | ||
.ipynb_checkpoints | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# celery beat schedule file | ||
celerybeat-schedule | ||
|
||
# dotenv | ||
.env | ||
|
||
# virtualenv | ||
venv/ | ||
ENV/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# pycharm | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Geosafe App for Geonode | ||
|
||
Geosafe is a django app that integrates InaSAFE Headless functionality into | ||
Geonode. This app adds new page that enabled user to: | ||
|
||
- Add InaSAFE based layer (Layer that contains InaSAFE keywords) | ||
- Create InaSAFE Analysis | ||
- Produce InaSAFE Analysis Reports | ||
|
||
Go to **Analysis** page to use this functionality | ||
|
||
# Setup | ||
|
||
Add this package as django app in your geonode installations. | ||
You have to override specific configuration to integrate InaSAFE Headless to | ||
this app. A sample settings can be seen in *local_settings.sample.py*. This | ||
settings file should be included in geonode settings file or called last, to | ||
make sure it was overriding celery settings in the default geonode settings. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import os | ||
import djcelery | ||
from kombu import Queue | ||
from celery.schedules import crontab | ||
|
||
# App specific | ||
# Geosafe - Celery settings | ||
|
||
# Pick the correct broker for relaying commands to InaSAFE Headless | ||
BROKER_URL = 'redis://localhost:6379/0' | ||
CELERY_RESULT_BACKEND = BROKER_URL | ||
|
||
# Specific celery settings. Can be modified accordingly or leave as default | ||
CELERY_ALWAYS_EAGER = False | ||
CELERY_EAGER_PROPAGATES_EXCEPTIONS = True | ||
CELERY_IGNORE_RESULT = False | ||
CELERY_SEND_EVENTS = True | ||
CELERY_TASK_RESULT_EXPIRES = 24 * 3600 | ||
CELERY_DISABLE_RATE_LIMITS = True | ||
CELERY_DEFAULT_QUEUE = "default" | ||
CELERY_DEFAULT_EXCHANGE = "default" | ||
CELERY_DEFAULT_EXCHANGE_TYPE = "direct" | ||
CELERY_DEFAULT_ROUTING_KEY = "default" | ||
CELERY_CREATE_MISSING_QUEUES = True | ||
|
||
# Defining Celery queue to avoid clash between tasks. Leave as default | ||
CELERY_QUEUES = [ | ||
Queue('default', routing_key='default'), | ||
Queue('cleanup', routing_key='cleanup'), | ||
Queue('update', routing_key='update'), | ||
Queue('email', routing_key='email'), | ||
Queue('inasafe-headless', routing_key='inasafe-headless'), | ||
Queue('geosafe', routing_key='geosafe'), | ||
] | ||
|
||
# Schedule for periodic tasks | ||
CELERYBEAT_SCHEDULE = { | ||
# executes every night at 0:0 AM | ||
'clean-impact-nightly': { | ||
'task': 'geosafe.tasks.analysis.clean_impact_result', | ||
'schedule': crontab(hour='0', minute='0') | ||
} | ||
} | ||
|
||
djcelery.setup_loader() | ||
|
||
# base url used to resolve layer files accessed by InaSAFE Headless | ||
GEONODE_BASE_URL = 'http://localhost:8000/' |