Skip to content
Snippets Groups Projects
Commit bd45d3af authored by James Graham's avatar James Graham
Browse files

Add api url to data source detail page - #66

parent 9095c424
No related branches found
No related tags found
No related merge requests found
......@@ -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>
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment