ku-polls/README.md

2.9 KiB

KU Polls: Online Survey Questions

Unit Tests

An application to conduct online polls and surveys based on the Django Tutorial project, with additional features.

Installation

Here is Install Instruction.

How to Run

Docker compose

  1. Clone the repository then create .env file in the following format
git clone https://github.com/Sosokker/ku-polls

.env Format

SECRET_KEY=your_secret_key
DEBUG=True
ALLOWED_HOSTS=localhost
TIME_ZONE=Asia/Bangkok
EMAIL_HOST_PASSWORD=yourpassword
  1. Run docker compose
docker compose up

Setup.py Method

Using setup.py method, it will set .env for you and runserver automatically with --insecure. You can set DEBUG=True later and then runserver normally to load static files.

Then, connect to http://127.0.0.1:8000/

Manual Installation

After follow all of instruction.

  • Set Virtual Environment and Use it.
  • Install Dependencies.
  • Migrate and then Load fixtures.
  • Set variable of .env

You can run with this command.

python manage.py runserver

Anyway, if you set DEBUG = False then django production server will not load static files for you. You need to set DEBUG = True or run this command.

python manage.py runserver --insecure

Then, connect to http://127.0.0.1:8000/


NOTE : If you have problems with port you can use runserver and specific your own port.

For example, If you run this command then you need to connect to http://127.0.0.1:7000/

python manage.py runserver 7000

Demo Superuser

Username Password
admin ineedmorebullets

Demo User

Username Password
tester1 aa12345678aa
tester2 aa12345678aa
tester3 aa12345678aa
tester4 aa12345678aa
novote aa12345678aa

Project Documents

All project documents are in the Project Wiki.

Django-Tutorial