Skip to content

Commit

Permalink
Merge pull request #960 from okfn/960-dont-use-api_url
Browse files Browse the repository at this point in the history
api_url needs to default to CKAN's mount URL.
  • Loading branch information
nigelbabu committed Nov 11, 2013
2 parents 596c950 + 04d6578 commit 31f30dc
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 28 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Expand Up @@ -12,6 +12,8 @@ v2.2

API changes and deprecations:


* The `ckan.api_url` has been completely removed and it can no longer be used
* The edit() and after_update() methods of IPackageController plugins are now
called when updating a resource using the web frontend or the
resource_update API action [#1052]
Expand Down
1 change: 0 additions & 1 deletion ckan/lib/app_globals.py
Expand Up @@ -44,7 +44,6 @@
'ckan.template_footer_end': {},
'ckan.dumps_url': {},
'ckan.dumps_format': {},
'ckan.api_url': {},
'ofs.impl': {'name': 'ofs_impl'},
'ckan.homepage_style': {'default': '1'},

Expand Down
2 changes: 1 addition & 1 deletion ckan/public/base/javascript/client.js
Expand Up @@ -370,7 +370,7 @@
});

ckan.sandbox.setup(function (instance) {
instance.client = new Client({endpoint: ckan.API_ROOT});
instance.client = new Client({endpoint: ckan.SITE_ROOT});
});

ckan.Client = Client;
Expand Down
1 change: 0 additions & 1 deletion ckan/public/base/javascript/main.js
Expand Up @@ -29,7 +29,6 @@ this.ckan = this.ckan || {};

ckan.SITE_ROOT = getRootFromData('siteRoot');
ckan.LOCALE_ROOT = getRootFromData('localeRoot');
ckan.API_ROOT = getRootFromData('apiRoot');

// Load the localisations before instantiating the modules.
ckan.sandbox().client.getLocaleData(locale).done(function (data) {
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/base.html
Expand Up @@ -85,7 +85,7 @@
</head>

{# Allows custom attributes to be added to the <body> tag #}
<body{% block bodytag %} data-site-root="{{ h.url('/', locale='default', qualified=true) }}" data-locale-root="{{ h.url('/', qualified=true) }}" data-api-root="{{ g.api_url }}"{% endblock %}>
<body{% block bodytag %} data-site-root="{{ h.url('/', locale='default', qualified=true) }}" data-locale-root="{{ h.url('/', qualified=true) }}" {% endblock %}>

{#
The page block allows you to add content to the page. Most of the time it is
Expand Down
18 changes: 0 additions & 18 deletions doc/configuration.rst
Expand Up @@ -130,24 +130,6 @@ site use this setting.

This setting should not have a trailing / on the end.

.. _ckan.api_url:

ckan.api_url
^^^^^^^^^^^^

.. deprecated:: 2
No longer used.

Example::

ckan.api_url = http://scotdata.ckan.net/api

Default value: ``/api``

The URL that resolves to the CKAN API part of the site. This is useful if the
API is hosted on a different domain, for example when a third-party site uses
the forms API.

.. _apikey_header_name:

apikey_header_name
Expand Down
6 changes: 0 additions & 6 deletions doc/legacy-api.rst
Expand Up @@ -434,12 +434,6 @@ front-end javascript.
All Util APIs are read-only. The response format is JSON. Javascript calls may
want to use the JSONP formatting.

.. Note::

Some CKAN deployments have the API deployed at a different domain to the main CKAN website. To make sure that the AJAX calls in the Web UI work, you'll need to configue the ckan.api_url. e.g.::

ckan.api_url = http://api.example.com/


dataset autocomplete
````````````````````
Expand Down

0 comments on commit 31f30dc

Please sign in to comment.