Skip to content
This repository has been archived by the owner on Mar 1, 2021. It is now read-only.

mlavin/fileapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django File API Example

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.

Project Requirements

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.

How to Use this Repo

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:

  1. Fresh Project
  2. Read Only API (Diff)
  3. Write API (Diff)
  4. Template Layout (Diff)
  5. File Listing (Diff)
  6. File Delete (Diff)
  7. File Upload (Diff)
  8. Token Authentication (Diff)
  9. Configuration (Diff)

Testing the application:

  1. Working Application
  2. Selenium Intro (Diff)
  3. Selenium Timeouts (Diff)
  4. Selenium File Interactions (Diff)
  5. Client Refactor (Diff)
  6. QUnit Setup (Diff)
  7. QUnit Fixtures (Diff)
  8. Sinon Mocks (Diff)
  9. Django Integration (Diff)

License

The project content is released under the BSD License. See the LICENSE file for more details.

About

Example project using Django and Backbone.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published