This is an example project created for the "Creating Enriching Web Applications with Django and Backbone.js" webcast http://www.oreilly.com/pub/e/3154 and extended by a follow up webcast "Testing Client-Side Applications with Django" http://www.oreilly.com/pub/e/3302
It demonstrates a basic REST API using Django and a JS client application using Backbone. This application is tested using integration tests written in Python using Selenium and using Javascript unit tests using QUnit.
You can find a demo application running at http://fileapi.mlavin.org (Login: guest/guest) Uploaded files must be less than 1 MB and the directory is cleared every 5 mins.
This project was written and tested using Python 3.3+. The Python dependencies are listed in the requirements.txt file. These can easily be installed with pip:
pip install -r requirements.txt
Using virtualenv is recommended.
The commits in the repo follow the creation of the API and client from start to finish. Branches have been created to note stopping points along the way. To see the project evolve throughout this process you should step through the branches in order.
Building the application:
- Fresh Project
- Read Only API (Diff)
- Write API (Diff)
- Template Layout (Diff)
- File Listing (Diff)
- File Delete (Diff)
- File Upload (Diff)
- Token Authentication (Diff)
- Configuration (Diff)
Testing the application:
- Working Application
- Selenium Intro (Diff)
- Selenium Timeouts (Diff)
- Selenium File Interactions (Diff)
- Client Refactor (Diff)
- QUnit Setup (Diff)
- QUnit Fixtures (Diff)
- Sinon Mocks (Diff)
- Django Integration (Diff)
The project content is released under the BSD License. See the LICENSE file for more details.