-
Notifications
You must be signed in to change notification settings - Fork 0
Iteration 2 Plan
Vichisorn edited this page Sep 14, 2020
·
4 revisions
Goal: improve the navigation and page layout, and add an ending date for voting on a poll. Another objective is to externalize configuration data for security and portability.
- In the Question class, add an
end_dateattribute that is the ending date for voting.- You need run migrations after this, to update the database schema.
- In the Question class, add two methods:
-
is_publishedreturns true if the current date is on or after the question’s publication date -
can_votereturns true if voting is currently allowed for this question Create unit tests foris_publishedandcan_vote.
-
- If someone navigates to the polls detail page for a poll where voting is not allowed, redirect them to the polls index page and show an error message.
- Suggest you use the “Django Messages Framework” for this. It’s simpler than passing an error_message via the context.
- Messages Framework is shown in topics list on class github.io site.
- Improve navigation.
- On the polls index page, add “vote” and “results” links for each question.
- Only show “vote” link for a poll where voting is allowed.
- On the polls detail page, add a “Back to List of Polls” link so a person can go back without voting. You can use your choice of text instead of “Back to List of Polls”.
- On the voting results page, also add a “Back to List of Polls” link.
- Improve the appearance of the voting results page. Make the votes align in a column, omit the word “votes” after the count – it’s redundant, remove the bullets.
- Index page - show all published poll questions, not just 5 most recent.
- Sort them so that the newest questions are first
- Externalize configuration data.
- Remove the value of SECRET_KEY and DEBUG from
settings.pyand put their values in a.envfile. - Don’t commit
.envto Git. - See Externalize Configuration for how to do this.
- Use either the
python-decoupleordjango-environpackage. They are described on the class github.io site under “Externalize Configuration”.
- Remove the value of SECRET_KEY and DEBUG from
All tasks should be recorded on Project Board for Iteration 1.
to be added
to be added.
to be added.