Skip to content

GToidZ/ku-polls

Repository files navigation

Online Polls for KU

tests status codecov

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.

Prerequisites

Required on any OS

  • Python 3.9 or greater
  • Python with ensurepip available

For Linux / Mac (x64)

  • sh
  • cURL

For Windows

  • 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.

Installation

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.

Running

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

Web Structure

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.

Project Documentation

Vision Statement

Requirements

Development Plan

Iterations

About

A Django assignment from ISP2022.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published