A polls application for Individual Software Process course at Kasetsart University.
This application is for conducting a poll or survey, written in Python using Django. It is based on the Django Tutorial project, and adds additional functionality.
Home Page | |
---|---|
Voting Page |
Requires Python 3.8 or newer. Required Python packages are listed in requirements.txt.
See Installation in the project wiki.
Brief Instructions:
- Copy
sample.env
to.env
and edit the settings. - Create a virtualenv:
python -m venv env
- Or create it using the virtualenv extension:
virtualenv env
- Or create it using the virtualenv extension:
- Activate the virtualenv and run
pip install -r requirements.txt
- Perform migrations and create a database:
python manage.my migrate
- Add polls and users to the database:
python manage.py loaddata polls users
-
Start the server in the virtual env.
# Activate the virtual env on Linux and MacOS source env/bin/activate # Or, on MS Windows: env\Scripts\activate # run the django server python3 manage.py runserver
This starts a web server listening on port 8000.
-
You should see this message printed in the terminal window:
Starting development server at http://127.0.0.1:8000/ Quit the server with CONTROL-C.
If you get a message that the port is unavailable, then run the server on a different port (1024 thru 65535). For example:
python3 manage.py runserver 12345
-
In a web browser, navigate to http://localhost:8000
-
To stop the server, press CTRL-C in the terminal window. Then exit the virtualenv by closing the window or typing:
deactivate
Sample polls and users data are included. There are 4 demo accounts:
demo1
passwordHackme1
demo2
passwordHackme2
demo3
passwordHackme3
demo4
passwordHackme4
You can create more user accounts using the script makeusers.py
. See instructions in the script.
All project-related documents are in the Project Wiki