Sample Ajax GET/POST Request in Django

Let us make a test scenario here: A dropdown field which on change we are going to send a Get/Post request to Django and return response. Let us start coding.... <select id="select_dropdown"> <option value='joshua'>joshua</option> <option value='peter'>peter</option> .... .... </select> Let's make an Ajax request after the change in the dropdown field. $(document).ready(function(){ $('#select_dropdown').change(function(){ var e = document.getElementById("select_dropdown"); var value = e.options[e.selectedIndex]…

Keep reading

RichText Editor in Django Admin Site

I wanted to add a rich text editor within django administrator. Its not that hard to add a rich text editor, as there are editors like ckeditor, tinymce. There are multiple plugins for django like django-ckeditor or django-tinymce etc. It seemed very complicated to use for me. So what I did here is that I have downloaded ckeditor stadard edition and extracted it in my Static folder and loaded the js file within templates>admin>base.html. Now, using firebug, I retrieved the textarea name/id/class in which I…

Keep reading