Skip to content

Commit

Permalink
Initial migration commit: Add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
lucernae committed Jun 29, 2016
1 parent 1ebf6f3 commit 68af678
Show file tree
Hide file tree
Showing 3 changed files with 161 additions and 0 deletions.
94 changes: 94 additions & 0 deletions .gitignore
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
19 changes: 19 additions & 0 deletions README.md
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.

48 changes: 48 additions & 0 deletions local_settings.sample.py
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/'

0 comments on commit 68af678

Please sign in to comment.