I have developed an application that generates a file location when a submit button is clicked.
json_path = os.path.join('json', request.POST['submit'], '.json' )
This code creates the file location within the \static\json\
directory.
I am including this information in a dictionary to be sent to the template.
render_dict = {
'json_path':json_path,
}
In my JavaScript code, I need to specify the location of the JSON file like so:
<script>
map.addSource('locationData', {
type: 'geojson',
data: "This is where the json file's location should go"
});
</script>
Does anyone know if it's possible to achieve this using template tagging?