Lab 9: Template README
Here is a template README file you could include in your final app submission, so that your marker knows exactly where to look for evidence of your learning.
Doing this is another way of showing that you understand the code you wrote!
Note: They will also be looking at your commit history, to see how much of the app you wrote from scratch.
Evidence
Checklist point | Evidence (filename(s) and line number(s) and/or short desciption) |
---|---|
write a simple server script which is capable of serving a web application written in Python | /rhouh001project/mysimpleServer.py |
retrieve one or more documents or rows from one or more collections or tables | /rhouh001project/cgi-bin/components.py line 38, 39, 40, 88, 89, 90, 91, 142 ; /rhouh001project/cgi-bin/splash.py line 16 |
iterate over documents returned in a results cursor object | /rhouh001project/cgi-bin/components.py, line 201 to 210 |
filter and/or sort documents in the result set based on some simple criteria | /rhouh001project/cgi-bin/components.py line 88, 89, 90, 91, 142, 145 |
perform more advanced filtering and/or aggregation operations in a database query | /rhouh001project/cgi-bin/components.py line 172, 197, 198, 199, 224 |
handle a POST request made via an HTML form in a server-side script | /rhouh001project/templates/form.py, /rhouh001/templates/register.html |
demonstrate consideration for Separation of Concerns through the modularisation (separation) of related code | From lab 7 to lab 9, forms are kept in the splash.py file and the html code is kept in the templates folder. For exemple, components.py uses the login.html file. in login.py and register.py, a seperate file is used to handle the login and registering of users, which handles sensitive data. |
demonstrate an awareness of how related data is modelled in the database | line 243 in components.py shows how data enters the database when a flcuk is made |
design and implement an original functional feature in a Python web app | in the lab 7 submission, I had designed a button to delete an image from the database so it doesnt appear again (for example cat images that arent cats). It did work but I did not add it back to the final part as I thought it could be abused. |
other relevant extension of the taught material (if applicable) | non applicable |
make a Python script self-executable | For example, the shebang (#!) on top of components.py |
utilise a range of Python's built-in functions and methods | In components.py, we import bcrypt in line 13, which was installed on the server. this lets our webserver use a feature that was installed and isnt part of base python, and encrypt passwords for the users of the application. |
make use of user-defined functions | config.py, myutils.py, tests.py |
design and implement reuseable functions | config.py, myutils.py, |
write readable, well-presented code | Most of the lab codes are easily readable, commented and presented. |
Installation instructions
-
The app requires Python 3+ and MongoDB 3.2 or later
-
The bcrypt and pymongo modules should be are available from your python environment
-
You should open and set the variables in cgi-bin/config.py to match your configuration
-
To launch,
./mysimpleServer.py
-
Restore the database by running
mongorestore
from the base directory -
After restoring the database, you can test the app with these login credentials:
- Username: tester
- Password: password