diff --git a/datasources/templates/datasources/datasource/detail.html b/datasources/templates/datasources/datasource/detail.html index 67152ed7bf0d97367a3d78e7d2d64636e39c01e5..d2a4c823b24511ab37f10a27af890603d72f5564 100644 --- a/datasources/templates/datasources/datasource/detail.html +++ b/datasources/templates/datasources/datasource/detail.html @@ -104,12 +104,16 @@ </td> </tr> <tr> - <td>URL</td> + <td>Licence</td> + <td>{{ datasource.licence.name }}</td> + </tr> + <tr> + <td>External API URL</td> <td>{{ datasource.url }}</td> </tr> <tr> - <td>Licence</td> - <td>{{ datasource.licence.name }}</td> + <td>Pedasi API URL</td> + <td>{{ api_url }}</td> </tr> </tbody> </table> diff --git a/datasources/views/datasource.py b/datasources/views/datasource.py index dbc90b468aa9ef7953e76ac2fd5dd1ecd261dc01..717dc4fbeec2287ce3e89bcd5d8911832d660e5f 100644 --- a/datasources/views/datasource.py +++ b/datasources/views/datasource.py @@ -44,6 +44,12 @@ class DataSourceDetailView(DetailView): except (KeyError, ValueError): messages.error(self.request, 'This data source is not configured correctly. Please notify the owner.') + context['api_url'] = ( + 'https://' if self.request.is_secure() else 'http://' + + self.request.get_host() + + '/api/datasources/{0}/data/'.format(self.object.pk) + ) + return context