Getting ready

Let's start with the quotes app that we created for the Uploading images recipe in Chapter 3, Forms and Views. We will reuse the model, and the view for adding a quote; however, we'll add views for handling the uploads, augmenting the form, and adding templates and JavaScript too.

Our own JavaScript will rely upon some external libraries, so those need to be downloaded:

  • From the jQuery File Upload widget available at https://blueimp.github.io/jQuery-File-Upload/, download and extract the 9.21.0 version. From the js/ folder in the extracted contents, we'll need jquery.fileupload.css, jquery.fileupload.js, and jquery.fileupload-ui.js. This utility also requires the jquery.ui.widget.js in turn, which is made available in a vendor/ subdirectory alongside the other files.
  • jQuery file upload makes use of the JavaScript templates system to provide something akin to Django templates, but in the browser. In support of this, we will need to get the tmpl.min.js file from that project, accessible at https://blueimp.github.io/JavaScript-Templates/.

Place the JavaScript files under static/site/js/lib, and static/site/css/lib is where the CSS should live. With that, we're ready to begin.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.68.18