Django-based voting platform for creating, managing, and voting on polls.
The project includes user accounts, poll categories, social authentication, email verification, and Docker-based deployment.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
- Poll creation
- Voting system
- Poll categories
- User profiles
- Voting history
- Dark mode
- Responsive layout
- Google and GitHub authentication
- Email verification
- reCAPTCHA protection
- Docker Compose setup
- Python 3.13
- Django 6.0
- PostgreSQL 16
- Gunicorn
- Nginx
- SASS / SCSS
- JavaScript
- django-allauth
- django-recaptcha
- Docker / Docker Compose
VotingSite
├── backend
│ ├── app
│ ├── polls
│ ├── user
│ ├── main
│ ├── templates
│ ├── static
│ ├── media
│ ├── fixtures
│ ├── Dockerfile
│ ├── entrypoint.sh
│ └── manage.py
├── conf.d
│ └── nginx.conf
├── compose.yml
├── requirements.txt
├── .env
└── README.md
Install Docker: https://docs.docker.com/engine/install/
Clone the repository:
git clone https://github.com/kapusta123b/VotingSite.git
cd VotingSiteEdit environment variables:
nano .envUpdate Nginx server name:
nano conf.d/nginx.confExample:
server_name your_server_ip_or_domain;Build and start containers:
docker compose up -d --buildApply migrations:
docker exec voting-web python manage.py migrateLoad demo data ( optional ):
docker exec voting-web python manage.py loaddata fixtures/user/users.json
docker exec voting-web python manage.py loaddata fixtures/polls/polls_Category.json
docker exec voting-web python manage.py loaddata fixtures/polls/polls_Question.json
docker exec voting-web python manage.py loaddata fixtures/polls/polls_Choice.jsonCreate admin user ( optional ):
docker exec voting-web python manage.py createsuperuserUse this setup for local development.
Clone the repository:
git clone https://github.com/kapusta123b/VotingSite.git
cd VotingSiteCreate virtual environment:
cd backend
python -m venv .venvActivate virtual environment:
Linux:
source .venv/bin/activateWindows:
.venv\Scripts\activateInstall dependencies:
pip install -r --no-cache-dir requirements.txtInstall PostgreSQL, create a user and a database, https://www.postgresql.org/download/, and then replace the values in the backend/.env file with your own.
# replace values with your own
DB_NAME=voting_db
DB_USER=voting_user
DB_PASS=voting_pass # user password
DB_HOST=localhost # don't touch
DB_PORT=5432 # don't touchApply migrations:
python manage.py migrate # important!Load demo data ( optional ):
python manage.py loaddata fixtures/user/users.json
python manage.py loaddata fixtures/polls/polls_Category.json
python manage.py loaddata fixtures/polls/polls_Question.json
python manage.py loaddata fixtures/polls/polls_Choice.jsonCreate admin user:
python manage.py createsuperuserRun development server:
python manage.py runserverSite is available at:
http://localhost:8000
Admin panel available at:
http://localhost:8000/admin
Log in as a superuser using the username and password created earlier
The project supports Google and GitHub authentication through django-allauth.
After deployment, create OAuth applications in Google Cloud Console and GitHub Developer Settings.
Required callback URLs:
http://your_domain/accounts/google/login/callback/
http://your_domain/accounts/github/login/callback/
Then add the providers in Django Admin:
Social Accounts -> Social Applications -> Add
Start containers:
docker compose compose.yml up -dStop containers:
docker compose compose.yml downStop containers and remove volumes:
docker compose compose.yml down -vRebuild containers:
docker compose compose.yml up -d --buildView logs:
docker compose compose.yml logs -fOpen Django shell:
docker exec votingsite-web-1 python manage.py shellOpen PostgreSQL shell:
docker exec votingsite-db-1 psql -U voting_user -d voting_dbBefore deployment, update:
.env- Nginx
server_name - OAuth credentials
Do not commit real secrets or production credentials to the repository.
MIT





