I have been working on a Django python application which I recently published to a public domain. Beforehand, I had tested my code, including a bit of code which records a user's signature after they draw it on a canvas, sends the signature to the server through the URL encoded in base64, and decodes it on the otherside.
After publishing, I am having some trouble sending this long encoded base64 URL. First, I overcame the Apache2 issue 'Request URI Too Long' by editing my apache2.conf:
AccessFileName .htaccess
LimitRequestLine 50000
Now I simply get '404 Not Found - The request URL was not found on the server'. The URL should be fine, in fact, it finds the URL just fine when I delete some of the length at the end of the URL. Of course, it can then no longer decode the URL. As you can see from my Django error log, there is no POST or GET request, although I am POSTing the code from a form on the page. I feel that this might be the underlying issue. I tried using javascript to POST as shown here.
<form action="/UserDashboard/SaveSignature/" id="FormSignature" method="POST" style="width: 60%; margin-left: 20%; margin-right: 20%; height: 60%;">
<input type="submit" value="Save Signature" style="background-color: whitesmoke; width: 40%; margin-left: 30%; margin-right: 30%; height: 28%; margin-top: 10%;"/>
</form>
$("#ChangeSignature").click(function() {
var canvas = document.querySelector("canvas");
var signaturePad = new SignaturePad(canvas, {
minWidth: 5,
maxWidth: 10,
penColor: "rgb(0, 0, 0)",
onEnd: function() {
changeLink(signaturePad.toDataURL());
}
});
});
EDIT: I would like to add that my Django urls.py path uses a path variable for 'dataURL', therefore any forward-slashes in the link should not affect what django interprets as the dataURL variable coming at the end of the link.