-
Was Not able to Host the webapp, tried many things like pythonanywhere and railway (had problem with firebase while hosting), (Hosting was the thing that took so much time)
-
So i Created a new repo (https://github.com/Gani-24/myVoting) and uploaded all the same files and removed the Firebase Functionality(Even without the Firebase Functionality the app works and completes all the requirements(i.e Storing the Votes for each candidates etc.) and hosted that on railway and it worked, the link i provided in the mail is for that website(https://myvoting-production.up.railway.app/), its actually the same app, so the data from that website will get stored in the same django admin panel(Votes, Users and Candidates and stuff).
-
Using Firebase i added the extra feature of storing the live votes received for whom and which position(showed in screenshot), So for the hosted website it also works perfectly fullfilling the requirements but without the firebase feature. For the Firebase Feature have to Clone this current repo and run the server locally and that will work. This Current Repo Has even firebase working, so can check this locally
A website which allows users to vote given multiple choices
Backend - For Backend I used Django
Frontend - For Frontend I used HTML5,Bootstrap
- User will be able to Register/Login
- User will have a Choice for the Title he wants to vote to
- User will have options of Candidates to vote for
- Will see the result screen after he completes Voting
- Admin can login to Django Administration and
- Can See No of Users Registered
- Can Add Users and Remove Users
- Can Add Candidates and Positions for Voting
- Can Check The No of Votes Each Candidate has Received.
- The Voting Data is also sent to Firebase RealTime Database, where the 'Live no of Votes', 'Candidate' and 'Title' is stored for each Vote received from the User under the node "votes".
This was my first project in Web Developement, Always wanted to start learning django and this was a great oppurtunity. I devoted a significant portion of my time to working on the backend (Django) side of the project.
-
To begin with, I started by creating simple HTML templates and spent a lot of time learning about Django, referring to multiple projects related to Django
-
I focused on implementing features such as login forms, registration forms, retrieving data, and authenticating in Django.
-
I spent the majority of my time learning how to add restrictions, such as allowing users to vote only once for a title, displaying a warning message for wrong usernames and passwords during authentication.
-
Once I had completed the basic requirements, I started learning about how to connect the Firebase Realtime Database to my project.
-
I spent some time working on this and managed to connect the database to receive the number of votes received, the candidate, and the title in real-time.
-
Only after I had completed the backend, did I begin working on the frontend part of the project. I went through some Bootstrap tutorials and created some decent-looking web pages, using what I had learned.
-
After Voting(wait for a few seconds for the data to be sent to firebase) Redirects to the Result Page

-
Admin Can see the No of Candidates and Positions Available and can add or delete them

-
Admin can see the live update in the Firebase Realtime database

- After cloning the repo, go to the virtual env where django is installed and run the command
python manage.py runserver
and go to the server given in the terminal after selecting a candidate and vote is clicked one time in the voting page, wait for a few seconds for the results page to load, as it takes a few seconds for the data to be sent to firebase
- https://www.youtube.com/watch?v=rHux0gMZ3Eg
- https://www.youtube.com/watch?v=jBzwzrDvZ18 (Select Parts of this Video)
- https://docs.djangoproject.com/en/4.1/ref/contrib/admin/
- https://www.section.io/engineering-education/integrating-firebase-database-in-django/
- https://www.youtube.com/watch?v=-IVtds5ufLY
- https://getbootstrap.com/docs/5.0/getting-started/introduction/
- https://www.youtube.com/watch?v=-qfEOE4vtxE (someparts of this)
- There were other small issues for which i Googled as well.







