├── LICENSE ├── README.md ├── accounts ├── __init__.py ├── admin.py ├── apps.py ├── forms.py ├── migrations │ └── __init__.py ├── models.py ├── templates │ └── accounts │ │ ├── login.html │ │ └── register.html ├── tests.py ├── urls.py └── views.py ├── manage.py ├── pollme ├── __init__.py ├── settings.py ├── urls.py ├── views.py └── wsgi.py ├── polls ├── __init__.py ├── admin.py ├── apps.py ├── forms.py ├── migrations │ ├── 0001_initial.py │ └── __init__.py ├── models.py ├── templates │ └── polls │ │ ├── add_choice.html │ │ ├── add_poll.html │ │ ├── endpoll.html │ │ ├── poll_detail.html │ │ ├── poll_edit.html │ │ ├── poll_result.html │ │ └── polls_list.html ├── tests.py ├── urls.py └── views.py ├── requirements.txt ├── seeder.py ├── static ├── css │ └── home_style.css └── img │ └── background.jpg └── templates ├── base.html ├── home.html └── includes └── navbar.html /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Aklilu Mandefro 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Poll application in Python Django 2 | 3 | Django poll app is a full featured polling app. You have to register in this app to show the polls and to vote. If you already voted you can not vote again. Only the owner of a poll can add poll , edit poll, update poll, delete poll , add choice, update choice, delete choice and end a poll. If a poll is ended it can not be voted. Ended poll only shows user the final result of the poll. There is a search option for polls. Also user can filter polls by name, publish date, and by number of voted. Pagination will work even after applying filter. 4 | 5 |
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
7 | 8 |python== 3.5 or up and django==2.0 or up
10 |
11 | open terminal and type13 |
git clone https://github.com/devmahmud/Django-poll-app.git
https://github.com/devmahmud/Django-poll-app.git
python manage.py makemigrations
python manage.py migrate
21 |
22 | python manage.py createsuperuser
24 |
25 | pip install faker
27 | python manage.py shell
28 | import seeder
29 | seeder.seed_all(30)
30 | Here 30 is a number of entry. You can use it as your own
31 | 32 |python manage.py runserver
34 |
35 | Then go to http://127.0.0.1:8000 in your browser
36 | 37 |86 | 87 | Thank you for browsing this repo. Any contributions you make are **greatly 88 | appreciated**. 89 | 90 | If you have a suggestion that would make this better, please fork the repo and 91 | create a pull request. You can also simply open an issue with the tag 92 | "enhancement". Don't forget to give the project a star! Thanks again! 93 | 94 | 1. Fork the Project 95 | 2. Create your Feature Branch 96 | 3. Commit your Changes 97 | 4. Push to the Branch 98 | 5. Open a Pull Request 99 | 100 |101 | 102 | ## 🙋♂️ Support 103 | #### 💙 If you like this project, give it a ⭐ and share it with friends! 104 | -------------------------------------------------------------------------------- /accounts/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aklilu-Mandefro/poll-application-in-python-django/341fcbf542f6337d21c134fb3b80f1b80086192e/accounts/__init__.py -------------------------------------------------------------------------------- /accounts/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /accounts/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class AccountsConfig(AppConfig): 5 | name = 'accounts' 6 | -------------------------------------------------------------------------------- /accounts/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | from django.contrib.auth.models import User 3 | 4 | 5 | class UserRegistrationForm(forms.Form): 6 | username = forms.CharField(label='Username', max_length=100, min_length=5, 7 | widget=forms.TextInput(attrs={'class': 'form-control'})) 8 | email = forms.EmailField(label='Email', max_length=35, min_length=5, 9 | widget=forms.EmailInput(attrs={'class': 'form-control'})) 10 | password1 = forms.CharField(label='Password', max_length=50, min_length=5, 11 | widget=forms.PasswordInput(attrs={'class': 'form-control'})) 12 | password2 = forms.CharField(label='Confirm Password', 13 | max_length=50, min_length=5, 14 | widget=forms.PasswordInput(attrs={'class': 'form-control'})) 15 | -------------------------------------------------------------------------------- /accounts/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aklilu-Mandefro/poll-application-in-python-django/341fcbf542f6337d21c134fb3b80f1b80086192e/accounts/migrations/__init__.py -------------------------------------------------------------------------------- /accounts/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /accounts/templates/accounts/login.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block content %} 4 |
Don't have an account? Sign 37 | Up
38 |Already have an account? Login Here
8 | {% if messages %} 9 | 18 | {% endif %} 19 | 24 | 16 | {% endfor %} 17 |