| .github/workflows | ||
| data | ||
| mysite | ||
| polls | ||
| .gitignore | ||
| manage.py | ||
| README.md | ||
| requirements.txt | ||
| sample.env | ||
| setup.ps1 | ||
| setup.py | ||
KU Polls: Online Survey Questions
An application to conduct online polls and surveys based on the Django Tutorial project, with additional features.
Install and Run
Run Setup.py Method
Clone this repository and Run setup.py to install and run the project
Don't forget to answer the question from setup.py to setup the project
git clone https://github.com/Sosokker/ku-polls
cd ku-polls
python setup.py
or run setup.ps1 (For Windows User)
Manual
- Install Python 3.11 or later
- Run these commands to clone and install requirements.txt
git clone https://github.com/Sosokker/ku-polls
cd ku-polls
pip install -r requirements.txt
- Create file call
.envinku-pollsdirectory and add this line
SECRET_KEY=your_secret_key
You can generate your own your_secret_key by this command
python manage.py shell -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"
or
Don't forget to change your_secret_key to your secret key (without quote)
You can look at sample.env for more information and others environment variables to set.
- Run these commands
python manage.py migrate
python manage.py loaddata data/users.json
python manage.py loaddata data/polls.json
python manage.py runserver
NOTE
By Default DEBUG=False and Django will not load Static files for you so if you want to apply CSS run this.
python manage.py runserver --insecure
or set DEBUG=True
or do the collectstatic
Then connect to http://127.0.0.1:8000/ or localhost:8000/
Recommend
You can create virtual environment by using this command before install requirements.txt
- Install virtualenv via pip
python -m pip install --user virtualenv
- Run these commands
python -m virtualenv .venv
- Use
virtual environment
.venv\Scripts\activate
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.