https://github.com/niloth-p/voteapplication
https://github.com/niloth-p/voteapplication
django ip-address rest-api voting-application
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/niloth-p/voteapplication
- Owner: Niloth-p
- License: mit
- Created: 2020-08-08T14:41:31.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-08T23:13:55.000Z (almost 6 years ago)
- Last Synced: 2025-06-01T13:20:56.427Z (about 1 year ago)
- Topics: django, ip-address, rest-api, voting-application
- Language: Python
- Homepage:
- Size: 2.23 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### Setup Instructions: Running the Project Locally
Install the requirements:
`pip install -r requirements.txt`
Setup the local configurations:
`cp .env.example .env`
Create the database:
`python manage.py migrate`
Finally, run the development server:
`python manage.py runserver`
The project will be available at 127.0.0.1:8000/voteapp/
### Usage:
* Go to 127.0.0.1:8000/voteapp/
* Click on any of the candidates' names to view their profile page
* Go back to the voting page
* Choose a candidate from the radio buttons, and click submit
* This will take you to the results page
* To clear your IP and re-vote, run the command:
`python manage.py shell < ClearIP.py`
### Features:
* Voting - once per IP
* Viewing candidates' profiles
* Viewing results
* Admin actions
- Add a new candidate
- Delete an existing candidate
* Candidate actions
- Edit details
#### Detailed features
* A clear_IP script for back-end testers to delete their IP from the database quickly to test re-voting.
* Back button of browser will redirect the voting page to the results page, after voting.
* Trying to get the details of a non-existent candidate returns 404.
* All the voters' IPs are stored in the database.
* The admins are given an authorization code, which needs to be present in the POST request, else access will be denied.
* The candidates are given a different authorization code to only edit the details.
### Settings variables
* Admin authorization code
* Candidate Authorization code