Homework 6ΒΆ

Due by noon on Thursday, Feb 20th. If you need an extension, ask.

  1. Merge hw5 into your master. Please don’t delete the ‘hw5’ branch :)

    Hand in this homework on branch ‘hw6’ on your github account, and set up a pull request between hw6 and your master branch. Don’t merge it, just set up the PR.

  2. Write a function that serves a file, together with the appropriate content-type. You can stick with image/jpeg and text/plain for now, e.g. a .jpg file would have content-type image/jpeg and a .txt file would be text/plain.

    Make /image serve an image (JPG), and /file serve a text file of some sort.

    Hint: ‘fp = open(filename, “rb”); data = fp.read(); fp.close()’

  3. Make sure you WSGI server works with all three of the Quixote demo apps, as in Day 13: Tuesday, Feb 18th, 2014. Note that the ‘login’ functionality in altdemo will not work yet; that’s OK.

  4. Use the wsgiref validator to evaluate your WSGI app. Apart from cookies, is anything else missing or broken? Fix the obvious things.

  5. Do a clean checkout of your repo and make sure that all the tests pass and that all your hw6 functionality works on the clean checkout.

    (“Clean checkout” means make a fresh clone of the repository somewhere else, so that you can be sure you’ve checked everything into the repo.)

Previous topic

Homework 7

Next topic

Day 13: Tuesday, Feb 18th, 2014

This Page

Edit this document!

This file can be edited directly through the Web. Anyone can update and fix errors in this document with few clicks -- no downloads needed.

  1. Go to Homework 6 on GitHub.
  2. Edit files using GitHub's text editor in your web browser (see the 'Edit' tab on the top right of the file)
  3. Fill in the Commit message text box at the bottom of the page describing why you made the changes. Press the Propose file change button next to it when done.
  4. Then click Send a pull request.
  5. Your changes are now queued for review under the project's Pull requests tab on GitHub!

For an introduction to the documentation format please see the reST primer.