Due: Wednesday Oct 10, 11pm.
Deadline: Wednesday, October 10, 11pm (NOT midnight).
Instructions: zip the whole bottle directory (the one with the server.py file), along with subdirectories, and submit it to this crowdgrader assignment: https://www.crowdgrader.org/crowdgrader/venues/view_venue/4033
Use zip, not 7z, rar, tgz, tar, or other formats. If you have zip/unzip available on the command line, and you are in the parent directory of the bottle directory, you can do:
zip -r hw1.zip my_bottle_dir
You can resubmit as many times as you want before the deadline.
You need to create a web page that is similar to the image below. All the images you need (and some more) are in this zip file.
Serving. You must use bottle.py, and your main file must be called, as in our class examples, server.py, so that it can be run with the command
python server.py
The page should be served by the top URL. There are two approaches to this. One is to use a template, for example, news.tpl, and write:
@get('/')
define news():
return template('news_template')
(You would have to define a template). Another way is to serve a static HTML file: you can create a subdirectory called html, put a news.html page there, and write:
@route('/'):
return static_file('news.html', root='html', mimetype='text/html')
It is up to you to decide which of these ways to use.
CSS Framework. You must use stupid.css as your css framework. See the examples done in class to see how to link to stupid.css from the head of the web page you are developing.
Quality. You should strive to create a page that is as nice as you can, but in practice, you are going to be graded on three types of things (the detailed rubric will be released soon):
To do the homework, I suggest you proceed as follows:
Some image files are .png; to serve those, do:
@route('/images/<filename:re:.*\.png>') def serve_image(filename): return static_file(filename, root='images', mimetype='image/png')
TBA
You may need a CrowdGrader subscription to be able to submit your assignment.