An application for conducting a poll or survey, written in Python using Django. It is based on the [Django Tutorial project][django-tutorial], with additional functionality.
This application is part of the Individual Software Process course at Kasetsart University.
-
Clone this project repository.
git clone https://github.com/natekrth/ku-polls.git
-
Go in to ku-polls directory.
cd ku-polls
-
Create a virtual environment.
python3 -m venv env
-
Start the virtual environment.
on macos and linux
source env/bin/activate
on windows
. env/bin/activate
-
Install required packages.
pip install -r requirements.txt
-
Create
.env
and write.SECRET_KEY = secret-key-value-without-quotes DEBUG = False TIME_ZONE = Asia/Bangkok ALLOWED_HOSTS = localhost,127.0.0.1
-
Create a new database by running migrations the database.
python3 manage.py migrate
-
Import and Export the database.
8.1 Import the database
python3 manage.py loaddata
.python3 manage.py loaddata data/polls.json data/users.json
8.2 Export the database
python3 manage.py dumpdata
(Optional). Try dump all polls data to a file (-o
) named polls.jsonpython3 manage.py dumpdata --indent=2 -o polls.json polls
-
Start running server.
python3 manage.py runserver
Username | Password |
---|---|
tester | nohack1234 |
hacker | hackme22 |
All project documents are in the Project Wiki