A web application for conducting online polls and surveys written in Python using Django web framework.
The application is based off the Django Tutorial but with tweaks.
The application is a part of the Individual Software Process course at Kasetsart University.
- Python 3.9 or greater
- Python with ensurepip available
- sh
- cURL
- System running on 64-bit
- Powershell 5 or greater
Note: The application might not work on Gentoo, Alpine. For Linux users, it is recommended to install lscpu
before setup.
Note: This is recommended for fresh installs, existing databases might be affected if installed in non-fresh repo.
Clone this repository into your desired location,
git clone https://github.com/GToidZ/ku-polls.git ku-polls
Change your directory into the repository,
cd ku-polls
Before doing anything else, you will need to configure your server using settings.ini
!
Take a look at settings.example.ini
on how you can create your own settings.ini
Alternatively, you can provide environment variables with the same name as options in the
settings.example.ini
instead, but it is recommended to use files since they are more persistant.
The next step is to setup the application by executing a script, choose the script that satisfies your operating system:
OS | File |
---|---|
Linux/GNU | setup-linux.sh |
Mac | setup-mac.sh |
Windows | setup-win.ps1 |
For example, in Linux:
./setup-linux.sh
For Linux/Mac: You might need to chmod +x
the script before running it.
For Linux/Mac (2): You can also specify which Python installation you will use by passing an argument to the script. ./setup-linux.sh python3.9
Now, follow the instructions on your prompt/terminal, and let the automation do the work.
Congratualations! Application successfully installed!
To start the application enter:
. ./.venv/bin/activate && python3 ./manage.py runserver 8000
When you see this message, it means that you have successfully installed the application! You can start running it by using the command at the bottom of message.
After installing, you should be able to start the server by using (while sourcing venv),
python3 ./manage.py runserver 8000
You can then visit, http://localhost:8000
The site has two links you can go to, /polls
and /admin
.
The main page is at /polls
. You can display polls that are currently open, view results of a poll and login to the application in order to vote. You can also visit this page via /
.
The admin page is at /admin
. You can create, edit, delete polls and users in here. It is recommended to setup your website here before going production.
- Iteration 1 Plan and Project Board
- Iteration 2 Plan and Project Board
- Iteration 3 Plan and Project Board
- Iteration 4 Plan and Project Board