{% extends "core/base.html" %}
{% load crispy_forms_tags %}

{% block section_title %}Add Device to Net{% endblock %}
{% block content %}
<div class="row">
<form method="post">
    {% csrf_token %}
    {{ form|crispy }}
    <button type="submit" class="btn btn-primary">Save</button>
    <a href="{{ request.META.HTTP_REFERER }}" class="btn btn-primary">Cancel</a>
    <input type="hidden" id="previous_page" name="previous_page" value="/previous/page/url">
</form>
<script>
    prev = document.getElementById("previous_page");
    prev.value = document.referrer;
</script>

</div>
{% endblock %}
