Your task in this assignment is to design and implement an extension to
your solution (or my
solution) to Assignment 1 which allowed users
to extend, browse and search a set of items with a range of attributes.
For this assignment, your solution must also provide the following
It must use the User model from
django.contrib.auth and a related UserProfile model
to represent users.
It must provide user registration, login and
logout of users. It should also provide profile view and
update, including password update.
It must restrict entry of new data items to logged-in users.
It must store the the identity of the user who created each
data item with the data item (as a foreign key).
It must allow the user who created a data item (and only
that user) to update or delete that data item.
It must provide a new modelCategory to represent
categories. Each category must have a name and a description.
Depending on your application domain, you may specify either
a many-to-one relationship or a many-to-many relationship between items
and categories. Again, depending on your application domain, you may
either allow logged-in users (and only logged-in users) to
create categories (in this case called tags) or
allow only administrators to create new categories. (In each case,
newly created categories are visible to all users.)
It must allow users to view recently added items (as in
Assignment 1), to view all items in a particular category, or to
search items by name or description from a single text
field. (There is no longer a
requirement to view all items in a single list.)
It must use pagination, including page numbers, to
display lists of data items (using the list-detail pattern as normal).
It must display the creator of each item on the item's details
If the creator of an item is logged in, it must also display
update and delete links or buttons on the item's
It must validate and sanitise all user entered data.
It must be implemented to avoid CSRF attacks.
It must, of course, allow administrators to create, update or
delete any data item through the administration interface.
Some of these properties are more important than others, e.g., user
authentication, create-update-delete restrictions and categories are
more important than pagination.
The project must use a single Django project and at least one
The project must be named "assignment2".
It must use models, views and templates. You can use either
user-defined views or generic views. All (generated) HTML documents
myst be valid HTML5 files.
It must use cascading style sheets to provide a simple,
uniform, distinctive design. This design must use common header
and footer, some background colour, and some appropriate image.
A bonus mark is available if your design works nicely on a
small-screen mobile device. (Hint. On small screens, present
content before navigation.)
It must contain a home page link and links for registration, login and
logout, and the name of any currently logged-in user, in a common
header on every page.
It must provide an administrative interface that
allows administrators to conveniently add, update and delete items and
users, as well as a public interface.
The project directory must contain a plain text README file
that identifies the project, describes what the project does (and
doesn't do), summarises how to use the project, and provides any other
useful information about the project.
It must use good program structuring techniques. As a minimum, all
files, models and views should be well commented and, ideally, there
should be no
unnecessarily repeated or unnecessarily long code. Template
inheritance should be used to ensure a uniform appearance and to avoid
writing repeated HTML.
All Python files must follow the Python style guidelines.
INSTALLED_APPS). You may lose marks for doing this by introducing
For our convenience, at least the home page of your project must
contain your name and student number.
These suggestions are similar to those for Assignment 1.
Start work soon!
First make a copy of your Assignment 1 solution:
$ cp -pr assignment1 assignment2
This will make a complete copy of assignment1 called
assignment2. You then have to change every occurrence of
assignment2 in assignment2 files.
Then clean up your solution to Assignment 1 (now called assignment2)
before attempting to extend it.
Seek advice if necessary.
Design and implement and test your extensions incrementally.
Start by designing or extending the models that define your data. This
task is critical.
Then decide which URLs you will need, which views are associated with each
script, and which templates are associated with each view.
Then incrementally design and implement the views and templates, testing
at each stage.
Clarifications and more detailed suggestions may be given in lectures and
We expect the structure of your application to be clear, simple,
standards-conformant, validated, and well-documented. We expect the
organisation and English in your implementation and documentation to be of
Assessment of your assignment will be based on functionality,
implementation, documentation and overall quality.
We will award approximately 10 marks for functionality, 4 marks for
interface and interaction design, 4 marks for implementation quality and 2
marks for submission and documentation.
We will be a bit stricter for Assignment 2 than we were for Assignment 1.
Keep your solution simple. You will not get additional credit for
doing more than was requested.
Ensure your database contains several items distributed across
at least two categories, and contains at least one registered user in
addition to an admin user.
Send me an email from your University account stating that
you wish to submit your assignment. The email must be prepared exactly
Subject: 7401ICT Assignment 2 Submission
The body of the email must contain the following:
Your official student name and number.
The exact path to your
Assignment 2 project directory, e.g.,
An admin username and password (preferably admin
/ password) for your project.
At least one other username and password for a registered
user who has added items to the database.
A zipped archive of your project directory,
e.g., s1234567_assignment2.zip, as an
Standard University late penalties of 2 marks (10%) per day to a
maximum of 5 days apply. Solutions submitted more than 5 days late will
not be accepted.
Plagiarism will be dealt with according to standard University
All use of work done by others must be properly cited.
Extensions will not be granted except for medical or other similar