Skip to content

Commit

Permalink
Merge branch 'master' into 3229-api-blueprint
Browse files Browse the repository at this point in the history
Conflicts:
	ckan/plugins/interfaces.py
	ckan/tests/logic/action/test_get.py
	requirements.txt
  • Loading branch information
amercader committed Sep 28, 2016
2 parents 0c0845e + a540864 commit 5d57511
Show file tree
Hide file tree
Showing 58 changed files with 2,753 additions and 1,316 deletions.
6 changes: 6 additions & 0 deletions ckan/config/deployment.ini_tmpl
Expand Up @@ -79,6 +79,12 @@ ckan.site_id = default
#solr_url = http://127.0.0.1:8983/solr


## Redis Settings

# URL to your Redis instance, including the database to be used.
#ckan.redis.url = redis://localhost:6379/0


## CORS Settings

# If cors.origin_allow_all is true, all origins are allowed.
Expand Down
20 changes: 9 additions & 11 deletions ckan/config/environment.py
Expand Up @@ -16,6 +16,7 @@
import ckan.plugins as p
import ckan.lib.helpers as helpers
import ckan.lib.app_globals as app_globals
from ckan.lib.redis import is_redis_available
import ckan.lib.render as render
import ckan.lib.search as search
import ckan.logic as logic
Expand Down Expand Up @@ -93,6 +94,10 @@ def find_controller(self, controller):
for msg in msgs:
warnings.filterwarnings('ignore', msg, sqlalchemy.exc.SAWarning)

# Check Redis availability
if not is_redis_available():
log.critical('Could not connect to Redis.')

# load all CKAN plugins
p.load_all()

Expand All @@ -105,6 +110,7 @@ def find_controller(self, controller):
'sqlalchemy.url': 'CKAN_SQLALCHEMY_URL',
'ckan.datastore.write_url': 'CKAN_DATASTORE_WRITE_URL',
'ckan.datastore.read_url': 'CKAN_DATASTORE_READ_URL',
'ckan.redis.url': 'CKAN_REDIS_URL',
'solr_url': 'CKAN_SOLR_URL',
'ckan.site_id': 'CKAN_SITE_ID',
'ckan.site_url': 'CKAN_SITE_URL',
Expand Down Expand Up @@ -245,17 +251,9 @@ def update_config():
# CONFIGURATION OPTIONS HERE (note: all config options will override
# any Pylons config options)

# for postgresql we want to enforce utf-8
sqlalchemy_url = config.get('sqlalchemy.url', '')
if sqlalchemy_url.startswith('postgresql://'):
extras = {'client_encoding': 'utf8'}
else:
extras = {}

engine = sqlalchemy.engine_from_config(config, 'sqlalchemy.', **extras)

if not model.meta.engine:
model.init_model(engine)
# Initialize SQLAlchemy
engine = sqlalchemy.engine_from_config(config, client_encoding='utf8')
model.init_model(engine)

for plugin in p.PluginImplementations(p.IConfigurable):
plugin.configure(config)
Expand Down
2 changes: 1 addition & 1 deletion ckan/config/resource_formats.json
Expand Up @@ -69,7 +69,7 @@
["TAR", "TAR Compressed File", "application/x-tar", []],
["PNG", "PNG Image File", "image/png", []],
["RSS", "RSS feed", "application/rss+xml", []],
["GeoJSON", "Geographic JavaScript Object Notation", null, []],
["GeoJSON", "Geographic JavaScript Object Notation", "application/geo+json", ["geojson"]],
["SHP", "Shapefile", null, ["esri shapefile"]],
["TORRENT", "Torrent", "application/x-bittorrent", ["bittorrent"]],
["ICS", "iCalendar", "text/calendar", ["ifb", "iCal"]],
Expand Down
170 changes: 0 additions & 170 deletions ckan/config/solr/schema-1.2.xml

This file was deleted.

0 comments on commit 5d57511

Please sign in to comment.