├── pollsite ├── home │ ├── __init__.py │ ├── migrations │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-38.pyc │ │ │ └── 0001_initial.cpython-38.pyc │ │ └── 0001_initial.py │ ├── tests.py │ ├── apps.py │ ├── admin.py │ ├── __pycache__ │ │ ├── apps.cpython-38.pyc │ │ ├── urls.cpython-38.pyc │ │ ├── admin.cpython-38.pyc │ │ ├── models.cpython-38.pyc │ │ ├── views.cpython-38.pyc │ │ └── __init__.cpython-38.pyc │ ├── urls.py │ ├── models.py │ ├── views.py │ ├── homePage.yaml │ └── templates │ │ └── home │ │ ├── opensource │ │ └── index ├── poll │ ├── __init__.py │ ├── migrations │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-38.pyc │ │ │ └── 0001_initial.cpython-38.pyc │ │ └── 0001_initial.py │ ├── apps.py │ ├── __pycache__ │ │ ├── apps.cpython-38.pyc │ │ ├── urls.cpython-38.pyc │ │ ├── admin.cpython-38.pyc │ │ ├── models.cpython-38.pyc │ │ ├── views.cpython-38.pyc │ │ └── __init__.cpython-38.pyc │ ├── tests.py │ ├── urls.py │ ├── admin.py │ ├── templates │ │ └── poll │ │ │ ├── results │ │ │ ├── vote │ │ │ └── index │ ├── models.py │ └── views.py ├── pollsite │ ├── __init__.py │ ├── __pycache__ │ │ ├── urls.cpython-38.pyc │ │ ├── wsgi.cpython-38.pyc │ │ ├── __init__.cpython-38.pyc │ │ └── settings.cpython-38.pyc │ ├── asgi.py │ ├── wsgi.py │ ├── urls.py │ └── settings.py ├── db.sqlite3 ├── templates │ ├── admin │ │ └── base_site.html │ └── base_layout.html ├── manage.py └── populator_script.py ├── ScreenShots ├── home_app_dir.png ├── poll_app_dir.png ├── pollsite_proj_dir.png ├── run_in_terminal.png ├── detail_file_struct.png ├── file_struct_overview.png ├── Screenshot from 2020-07-15 18-32-11.png ├── Screenshot from 2020-07-15 18-32-23.png ├── Screenshot from 2020-07-15 18-32-27.png ├── Screenshot from 2020-07-15 18-32-30.png ├── Screenshot from 2020-07-15 18-33-15.png ├── Screenshot from 2020-07-15 18-33-36.png ├── Screenshot from 2020-07-15 18-33-41.png ├── Screenshot from 2020-07-15 18-33-46.png ├── Screenshot from 2020-07-15 18-33-50.png ├── Screenshot from 2020-07-15 18-33-57.png ├── Screenshot from 2020-07-15 18-34-02.png ├── Screenshot from 2020-07-15 18-34-16.png ├── Screenshot from 2020-07-15 18-34-25.png ├── Screenshot from 2020-07-15 18-34-54.png ├── Screenshot from 2020-07-15 18-35-07.png ├── Screenshot from 2020-07-15 18-35-45.png ├── Screenshot from 2020-07-15 18-35-49.png ├── Screenshot from 2020-07-15 18-35-54.png ├── Screenshot from 2020-07-15 18-36-05.png ├── Screenshot from 2020-07-15 18-36-19.png ├── Screenshot from 2020-07-15 18-36-35.png ├── Screenshot from 2020-07-15 18-36-43.png ├── Screenshot from 2020-07-15 18-36-48.png ├── Screenshot from 2020-07-15 18-36-51.png ├── Screenshot from 2020-07-15 18-36-55.png ├── Screenshot from 2020-07-15 18-36-59.png ├── Screenshot from 2020-07-15 18-37-08.png ├── Screenshot from 2020-07-15 18-37-19.png ├── Screenshot from 2020-07-15 18-37-37.png ├── Screenshot_2020-07-15-18-46-31-065_com.android.chrome.jpg ├── Screenshot_2020-07-15-18-46-44-381_com.android.chrome.jpg ├── Screenshot_2020-07-15-18-46-51-856_com.android.chrome.jpg ├── Screenshot_2020-07-15-18-46-58-717_com.android.chrome.jpg ├── Screenshot_2020-07-15-18-47-08-234_com.android.chrome.jpg ├── Screenshot_2020-07-15-18-47-17-773_com.android.chrome.jpg ├── Screenshot_2020-07-15-18-47-24-862_com.android.chrome.jpg ├── Screenshot_2020-07-15-18-47-31-306_com.android.chrome.jpg ├── Screenshot_2020-07-15-18-47-37-522_com.android.chrome.jpg ├── Screenshot_2020-07-15-18-47-43-767_com.android.chrome.jpg ├── Screenshot_2020-07-15-18-47-59-693_com.android.chrome.jpg ├── Screenshot_2020-07-15-18-48-25-475_com.android.chrome.jpg ├── Screenshot_2020-07-15-18-48-33-555_com.android.chrome.jpg ├── Screenshot_2020-07-15-18-48-53-709_com.android.chrome.jpg ├── Screenshot_2020-07-15-18-49-08-944_com.android.chrome.jpg ├── Screenshot_2020-07-15-18-49-27-536_com.android.chrome.jpg ├── Screenshot_2020-07-15-18-49-50-589_com.android.chrome.jpg ├── Screenshot_2020-07-15-18-50-14-125_com.android.chrome.jpg ├── Screenshot_2020-07-15-18-50-44-057_com.android.chrome.jpg ├── Screenshot_2020-07-15-18-50-53-415_com.android.chrome.jpg ├── Screenshot_2020-07-15-18-51-02-783_com.android.chrome.jpg ├── Screenshot_2020-07-15-18-51-10-692_com.android.chrome.jpg ├── Screenshot_2020-07-15-18-51-20-457_com.android.chrome.jpg └── Screenshot_2020-07-15-18-51-30-308_com.android.chrome.jpg ├── CodePreview ├── Screenshot from 2020-07-15 19-07-25.png ├── Screenshot from 2020-07-15 19-07-29.png ├── Screenshot from 2020-07-15 19-07-34.png ├── Screenshot from 2020-07-15 19-07-39.png ├── Screenshot from 2020-07-15 19-07-46.png ├── Screenshot from 2020-07-15 19-07-49.png ├── Screenshot from 2020-07-15 19-07-52.png ├── Screenshot from 2020-07-15 19-07-55.png ├── Screenshot from 2020-07-15 19-08-12.png ├── Screenshot from 2020-07-15 19-08-16.png ├── Screenshot from 2020-07-15 19-08-27.png ├── Screenshot from 2020-07-15 19-08-34.png ├── Screenshot from 2020-07-15 19-08-47.png └── Screenshot from 2020-07-15 19-09-16.png ├── requirements.txt ├── LICENSE └── README.md /pollsite/home/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pollsite/poll/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pollsite/pollsite/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pollsite/home/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pollsite/poll/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pollsite/home/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /pollsite/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/pollsite/db.sqlite3 -------------------------------------------------------------------------------- /ScreenShots/home_app_dir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/home_app_dir.png -------------------------------------------------------------------------------- /ScreenShots/poll_app_dir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/poll_app_dir.png -------------------------------------------------------------------------------- /ScreenShots/pollsite_proj_dir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/pollsite_proj_dir.png -------------------------------------------------------------------------------- /ScreenShots/run_in_terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/run_in_terminal.png -------------------------------------------------------------------------------- /pollsite/home/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class HomeConfig(AppConfig): 5 | name = 'home' 6 | -------------------------------------------------------------------------------- /pollsite/poll/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class PollConfig(AppConfig): 5 | name = 'poll' 6 | -------------------------------------------------------------------------------- /ScreenShots/detail_file_struct.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/detail_file_struct.png -------------------------------------------------------------------------------- /ScreenShots/file_struct_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/file_struct_overview.png -------------------------------------------------------------------------------- /pollsite/home/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import TeamMember 3 | 4 | admin.site.register(TeamMember) 5 | -------------------------------------------------------------------------------- /pollsite/home/__pycache__/apps.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/pollsite/home/__pycache__/apps.cpython-38.pyc -------------------------------------------------------------------------------- /pollsite/home/__pycache__/urls.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/pollsite/home/__pycache__/urls.cpython-38.pyc -------------------------------------------------------------------------------- /pollsite/poll/__pycache__/apps.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/pollsite/poll/__pycache__/apps.cpython-38.pyc -------------------------------------------------------------------------------- /pollsite/poll/__pycache__/urls.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/pollsite/poll/__pycache__/urls.cpython-38.pyc -------------------------------------------------------------------------------- /pollsite/home/__pycache__/admin.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/pollsite/home/__pycache__/admin.cpython-38.pyc -------------------------------------------------------------------------------- /pollsite/home/__pycache__/models.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/pollsite/home/__pycache__/models.cpython-38.pyc -------------------------------------------------------------------------------- /pollsite/home/__pycache__/views.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/pollsite/home/__pycache__/views.cpython-38.pyc -------------------------------------------------------------------------------- /pollsite/poll/__pycache__/admin.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/pollsite/poll/__pycache__/admin.cpython-38.pyc -------------------------------------------------------------------------------- /pollsite/poll/__pycache__/models.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/pollsite/poll/__pycache__/models.cpython-38.pyc -------------------------------------------------------------------------------- /pollsite/poll/__pycache__/views.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/pollsite/poll/__pycache__/views.cpython-38.pyc -------------------------------------------------------------------------------- /pollsite/home/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/pollsite/home/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /pollsite/poll/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/pollsite/poll/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /pollsite/pollsite/__pycache__/urls.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/pollsite/pollsite/__pycache__/urls.cpython-38.pyc -------------------------------------------------------------------------------- /pollsite/pollsite/__pycache__/wsgi.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/pollsite/pollsite/__pycache__/wsgi.cpython-38.pyc -------------------------------------------------------------------------------- /CodePreview/Screenshot from 2020-07-15 19-07-25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/CodePreview/Screenshot from 2020-07-15 19-07-25.png -------------------------------------------------------------------------------- /CodePreview/Screenshot from 2020-07-15 19-07-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/CodePreview/Screenshot from 2020-07-15 19-07-29.png -------------------------------------------------------------------------------- /CodePreview/Screenshot from 2020-07-15 19-07-34.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/CodePreview/Screenshot from 2020-07-15 19-07-34.png -------------------------------------------------------------------------------- /CodePreview/Screenshot from 2020-07-15 19-07-39.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/CodePreview/Screenshot from 2020-07-15 19-07-39.png -------------------------------------------------------------------------------- /CodePreview/Screenshot from 2020-07-15 19-07-46.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/CodePreview/Screenshot from 2020-07-15 19-07-46.png -------------------------------------------------------------------------------- /CodePreview/Screenshot from 2020-07-15 19-07-49.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/CodePreview/Screenshot from 2020-07-15 19-07-49.png -------------------------------------------------------------------------------- /CodePreview/Screenshot from 2020-07-15 19-07-52.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/CodePreview/Screenshot from 2020-07-15 19-07-52.png -------------------------------------------------------------------------------- /CodePreview/Screenshot from 2020-07-15 19-07-55.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/CodePreview/Screenshot from 2020-07-15 19-07-55.png -------------------------------------------------------------------------------- /CodePreview/Screenshot from 2020-07-15 19-08-12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/CodePreview/Screenshot from 2020-07-15 19-08-12.png -------------------------------------------------------------------------------- /CodePreview/Screenshot from 2020-07-15 19-08-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/CodePreview/Screenshot from 2020-07-15 19-08-16.png -------------------------------------------------------------------------------- /CodePreview/Screenshot from 2020-07-15 19-08-27.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/CodePreview/Screenshot from 2020-07-15 19-08-27.png -------------------------------------------------------------------------------- /CodePreview/Screenshot from 2020-07-15 19-08-34.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/CodePreview/Screenshot from 2020-07-15 19-08-34.png -------------------------------------------------------------------------------- /CodePreview/Screenshot from 2020-07-15 19-08-47.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/CodePreview/Screenshot from 2020-07-15 19-08-47.png -------------------------------------------------------------------------------- /CodePreview/Screenshot from 2020-07-15 19-09-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/CodePreview/Screenshot from 2020-07-15 19-09-16.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-32-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-32-11.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-32-23.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-32-23.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-32-27.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-32-27.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-32-30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-32-30.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-33-15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-33-15.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-33-36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-33-36.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-33-41.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-33-41.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-33-46.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-33-46.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-33-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-33-50.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-33-57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-33-57.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-34-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-34-02.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-34-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-34-16.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-34-25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-34-25.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-34-54.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-34-54.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-35-07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-35-07.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-35-45.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-35-45.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-35-49.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-35-49.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-35-54.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-35-54.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-36-05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-36-05.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-36-19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-36-19.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-36-35.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-36-35.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-36-43.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-36-43.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-36-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-36-48.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-36-51.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-36-51.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-36-55.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-36-55.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-36-59.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-36-59.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-37-08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-37-08.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-37-19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-37-19.png -------------------------------------------------------------------------------- /ScreenShots/Screenshot from 2020-07-15 18-37-37.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot from 2020-07-15 18-37-37.png -------------------------------------------------------------------------------- /pollsite/pollsite/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/pollsite/pollsite/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /pollsite/pollsite/__pycache__/settings.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/pollsite/pollsite/__pycache__/settings.cpython-38.pyc -------------------------------------------------------------------------------- /pollsite/home/migrations/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/pollsite/home/migrations/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /pollsite/poll/migrations/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/pollsite/poll/migrations/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /pollsite/home/migrations/__pycache__/0001_initial.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/pollsite/home/migrations/__pycache__/0001_initial.cpython-38.pyc -------------------------------------------------------------------------------- /pollsite/poll/migrations/__pycache__/0001_initial.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/pollsite/poll/migrations/__pycache__/0001_initial.cpython-38.pyc -------------------------------------------------------------------------------- /ScreenShots/Screenshot_2020-07-15-18-46-31-065_com.android.chrome.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot_2020-07-15-18-46-31-065_com.android.chrome.jpg -------------------------------------------------------------------------------- /ScreenShots/Screenshot_2020-07-15-18-46-44-381_com.android.chrome.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot_2020-07-15-18-46-44-381_com.android.chrome.jpg -------------------------------------------------------------------------------- /ScreenShots/Screenshot_2020-07-15-18-46-51-856_com.android.chrome.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot_2020-07-15-18-46-51-856_com.android.chrome.jpg -------------------------------------------------------------------------------- /ScreenShots/Screenshot_2020-07-15-18-46-58-717_com.android.chrome.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot_2020-07-15-18-46-58-717_com.android.chrome.jpg -------------------------------------------------------------------------------- /ScreenShots/Screenshot_2020-07-15-18-47-08-234_com.android.chrome.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot_2020-07-15-18-47-08-234_com.android.chrome.jpg -------------------------------------------------------------------------------- /ScreenShots/Screenshot_2020-07-15-18-47-17-773_com.android.chrome.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot_2020-07-15-18-47-17-773_com.android.chrome.jpg -------------------------------------------------------------------------------- /ScreenShots/Screenshot_2020-07-15-18-47-24-862_com.android.chrome.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot_2020-07-15-18-47-24-862_com.android.chrome.jpg -------------------------------------------------------------------------------- /ScreenShots/Screenshot_2020-07-15-18-47-31-306_com.android.chrome.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot_2020-07-15-18-47-31-306_com.android.chrome.jpg -------------------------------------------------------------------------------- /ScreenShots/Screenshot_2020-07-15-18-47-37-522_com.android.chrome.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot_2020-07-15-18-47-37-522_com.android.chrome.jpg -------------------------------------------------------------------------------- /ScreenShots/Screenshot_2020-07-15-18-47-43-767_com.android.chrome.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot_2020-07-15-18-47-43-767_com.android.chrome.jpg -------------------------------------------------------------------------------- /ScreenShots/Screenshot_2020-07-15-18-47-59-693_com.android.chrome.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot_2020-07-15-18-47-59-693_com.android.chrome.jpg -------------------------------------------------------------------------------- /ScreenShots/Screenshot_2020-07-15-18-48-25-475_com.android.chrome.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot_2020-07-15-18-48-25-475_com.android.chrome.jpg -------------------------------------------------------------------------------- /ScreenShots/Screenshot_2020-07-15-18-48-33-555_com.android.chrome.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot_2020-07-15-18-48-33-555_com.android.chrome.jpg -------------------------------------------------------------------------------- /ScreenShots/Screenshot_2020-07-15-18-48-53-709_com.android.chrome.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot_2020-07-15-18-48-53-709_com.android.chrome.jpg -------------------------------------------------------------------------------- /ScreenShots/Screenshot_2020-07-15-18-49-08-944_com.android.chrome.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot_2020-07-15-18-49-08-944_com.android.chrome.jpg -------------------------------------------------------------------------------- /ScreenShots/Screenshot_2020-07-15-18-49-27-536_com.android.chrome.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot_2020-07-15-18-49-27-536_com.android.chrome.jpg -------------------------------------------------------------------------------- /ScreenShots/Screenshot_2020-07-15-18-49-50-589_com.android.chrome.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot_2020-07-15-18-49-50-589_com.android.chrome.jpg -------------------------------------------------------------------------------- /ScreenShots/Screenshot_2020-07-15-18-50-14-125_com.android.chrome.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot_2020-07-15-18-50-14-125_com.android.chrome.jpg -------------------------------------------------------------------------------- /ScreenShots/Screenshot_2020-07-15-18-50-44-057_com.android.chrome.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot_2020-07-15-18-50-44-057_com.android.chrome.jpg -------------------------------------------------------------------------------- /ScreenShots/Screenshot_2020-07-15-18-50-53-415_com.android.chrome.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot_2020-07-15-18-50-53-415_com.android.chrome.jpg -------------------------------------------------------------------------------- /ScreenShots/Screenshot_2020-07-15-18-51-02-783_com.android.chrome.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot_2020-07-15-18-51-02-783_com.android.chrome.jpg -------------------------------------------------------------------------------- /ScreenShots/Screenshot_2020-07-15-18-51-10-692_com.android.chrome.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot_2020-07-15-18-51-10-692_com.android.chrome.jpg -------------------------------------------------------------------------------- /ScreenShots/Screenshot_2020-07-15-18-51-20-457_com.android.chrome.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot_2020-07-15-18-51-20-457_com.android.chrome.jpg -------------------------------------------------------------------------------- /ScreenShots/Screenshot_2020-07-15-18-51-30-308_com.android.chrome.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aahnik/django-polling-site/HEAD/ScreenShots/Screenshot_2020-07-15-18-51-30-308_com.android.chrome.jpg -------------------------------------------------------------------------------- /pollsite/home/urls.py: -------------------------------------------------------------------------------- 1 | from . import views 2 | from django.urls import path 3 | 4 | urlpatterns = [ 5 | path('', views.index, name='index'), 6 | path('opensource/', views.opnsrc, name='opensource') 7 | ] 8 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.2.10 2 | Django==2.1.7 3 | django-populate==0.3.2 4 | Faker==1.0.2 5 | python-dateutil==2.8.0 6 | pytz==2018.9 7 | PyYAML==5.4 8 | six==1.12.0 9 | sqlparse==0.3.1 10 | text-unidecode==1.2 11 | -------------------------------------------------------------------------------- /pollsite/templates/admin/base_site.html: -------------------------------------------------------------------------------- 1 | {% extends "admin/base.html" %} 2 | 3 | {% block title %}{{ title }} | {{ site_title|default:_('Django site admin') }}{% endblock %} 4 | 5 | {% block branding %} 6 |

Canvass Poll-App Admin

7 | {% endblock %} 8 | 9 | {% block nav-global %}{% endblock %} -------------------------------------------------------------------------------- /pollsite/home/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | 4 | class TeamMember(models.Model): 5 | title = models.CharField('Name', max_length=20) 6 | role = models.CharField('Role', max_length=20) 7 | bio = models.CharField('About', max_length=50) 8 | imgUrl = models.URLField('Image URL') 9 | 10 | def __str__(self): 11 | return self.title 12 | -------------------------------------------------------------------------------- /pollsite/poll/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | from django.utils import timezone 3 | from .models import Question, Choice 4 | import datetime 5 | 6 | 7 | class QuestionModelTests(TestCase): 8 | 9 | def test_was_published_recently_with_future_question(self): 10 | time = timezone.now() + datetime.timedelta(days=30) 11 | future_question = Question(pub_date=time) 12 | self.assertIs(future_question.recent(), False) 13 | -------------------------------------------------------------------------------- /pollsite/pollsite/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for pollsite project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'pollsite.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /pollsite/pollsite/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for pollsite project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'pollsite.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /pollsite/poll/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | 3 | from . import views 4 | 5 | app_name = 'poll' # NOTE registering the namespace 6 | 7 | urlpatterns = [ 8 | # ex: /poll/ 9 | path('', views.index, name='index'), 10 | # ex: /poll/5/ 11 | # path('/', views.detail, name='detail'), 12 | # ex: /poll/5/results/ 13 | path('/results/', views.results, name='results'), 14 | # ex: /poll/5/vote/ 15 | path('/vote/', views.vote, name='vote'), 16 | ] 17 | -------------------------------------------------------------------------------- /pollsite/poll/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | from .models import Question, Choice 4 | 5 | 6 | class ChoiceInline(admin.TabularInline): 7 | model = Choice 8 | extra = 2 9 | 10 | 11 | class QuestionAdmin(admin.ModelAdmin): 12 | fieldsets = [ 13 | (None, {'fields': ['featured']}), 14 | ('Question Information', {'fields': ['title', 'desc']}), 15 | ('Date Information', {'fields': ['pub_date']}), 16 | ] 17 | inlines = [ChoiceInline] 18 | list_display = ('title', 'recent', 'pub_date', 'participants') 19 | list_filter = ['pub_date'] 20 | search_fields = ['title'] 21 | 22 | 23 | admin.site.register(Question, QuestionAdmin) 24 | -------------------------------------------------------------------------------- /pollsite/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'pollsite.settings') 9 | try: 10 | from django.core.management import execute_from_command_line 11 | except ImportError as exc: 12 | raise ImportError( 13 | "Couldn't import Django. Are you sure it's installed and " 14 | "available on your PYTHONPATH environment variable? Did you " 15 | "forget to activate a virtual environment?" 16 | ) from exc 17 | execute_from_command_line(sys.argv) 18 | 19 | 20 | if __name__ == '__main__': 21 | main() 22 | -------------------------------------------------------------------------------- /pollsite/poll/templates/poll/results: -------------------------------------------------------------------------------- 1 | {% extends "base_layout.html" %} 2 | 3 | {% block title %} 4 | 5 | Canvas Results of a Poll 6 | 7 | {% endblock %} 8 | 9 | {% block content %} 10 |

{{ question.title }}

11 | 12 |
    13 | {% for choice in question.choice_set.all %} 14 |
    15 |
  • {{ choice.choice_text }} -- {{ choice.votes }} vote{{ choice.votes|pluralize }}
  • 16 | {% endfor %} 17 |
18 | 19 |

the looks of this page sucks!! I know that ... 20 | I AM NOT A FRONTEND DEV, i work mainly on backend, my work is to implement functionality 21 | not to visually appeal you 22 | If you know frontend , contribute improvements to this page 23 |

24 |
25 | GitHub Repo 26 | 27 | {% endblock %} -------------------------------------------------------------------------------- /pollsite/home/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2020-07-15 14:51 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | initial = True 9 | 10 | dependencies = [ 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='TeamMember', 16 | fields=[ 17 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 18 | ('title', models.CharField(max_length=20, verbose_name='Name')), 19 | ('role', models.CharField(max_length=20, verbose_name='Role')), 20 | ('bio', models.CharField(max_length=50, verbose_name='About')), 21 | ('imgUrl', models.URLField(verbose_name='Image URL')), 22 | ], 23 | ), 24 | ] 25 | -------------------------------------------------------------------------------- /pollsite/home/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render, get_object_or_404 2 | from .models import TeamMember 3 | 4 | import yaml 5 | from django.utils import timezone 6 | import os 7 | 8 | 9 | def index(request): 10 | # NOTE PUT ABSOLUTE PATH OF homePage.yaml here 11 | with open('__PUT ABSOLUTE PATH OF homePage.yaml here__', 'r') as file: 12 | homePageElements = yaml.full_load(file) 13 | stats = { 14 | 'forks': 10, 15 | 'choices': '100%', 16 | 'participants': 200, 17 | 'questions': '24/7' 18 | } 19 | team = TeamMember.objects.order_by('title') 20 | context = {'hpe': homePageElements, 'team': team, 'stats': stats} 21 | return render(request, 'home/index', context) 22 | 23 | 24 | def opnsrc(request): 25 | now = timezone.now() 26 | context = {'now': now} 27 | return render(request, 'home/opensource', context) 28 | -------------------------------------------------------------------------------- /pollsite/pollsite/urls.py: -------------------------------------------------------------------------------- 1 | """pollsite URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.0/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path, include 18 | 19 | urlpatterns = [ 20 | path('', include('home.urls')), 21 | path('poll/', include('poll.urls')), 22 | path('admin/', admin.site.urls), 23 | ] 24 | -------------------------------------------------------------------------------- /pollsite/poll/templates/poll/vote: -------------------------------------------------------------------------------- 1 | {% extends "base_layout.html" %} 2 | 3 | {% block title %} 4 | 5 | Canvas Vote in a Poll 6 | 7 | {% endblock %} 8 | {% block content %} 9 |

{{ question.title }}

10 | 11 | {% if error_message %}

{{ error_message }}

{% endif %} 12 | 13 |
14 | {% csrf_token %} 15 | {% for choice in question.choice_set.all %} 16 | 17 |
18 |
19 | {% endfor %} 20 |
21 | 22 |
23 | {% endblock %} 24 |
25 |

the looks of this page sucks!! I know that ... 26 | I AM NOT A FRONTEND DEV, i work mainly on backend, my work is to implement functionality 27 | not to visually appeal you 28 | If you know frontend , contribute improvements to this page 29 |

30 |
31 | GitHub Repo -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 AAHNIK DAW 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 | -------------------------------------------------------------------------------- /pollsite/poll/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | import datetime 3 | from django.utils import timezone 4 | 5 | 6 | class Question(models.Model): 7 | title = models.CharField('Question', max_length=50) 8 | desc = models.TextField('Description', max_length=200) 9 | pub_date = models.DateTimeField('Date Published') 10 | featured = models.BooleanField('Feature in Featured Polls Page') 11 | 12 | def __str__(self): 13 | return self.title 14 | 15 | def recent(self): 16 | now = timezone.now() 17 | return now - datetime.timedelta(days=1) <= self.pub_date <= now 18 | 19 | def participants(self): 20 | participants = 0 21 | choices = self.choice_set.all() 22 | for choice in choices: 23 | participants += choice.votes 24 | return participants 25 | 26 | 27 | recent.admin_order_field = 'pub_date' 28 | recent.boolean = True 29 | 30 | 31 | class Choice(models.Model): 32 | question = models.ForeignKey(Question, on_delete=models.CASCADE) 33 | choice_text = models.CharField(max_length=100) 34 | votes = models.IntegerField(default=0) 35 | 36 | def __str__(self): 37 | return self.choice_text 38 | -------------------------------------------------------------------------------- /pollsite/populator_script.py: -------------------------------------------------------------------------------- 1 | """ 2 | NOTE 3 | SEE README FOR DETAILS ABOUT RUNNING THIS PYTHON SCRIPT 4 | 5 | """ 6 | 7 | 8 | from django.utils import timezone 9 | 10 | # run from manage.py shell otherwise you will face error 11 | from poll.models import Question, Choice 12 | 13 | import random 14 | import string 15 | import datetime 16 | 17 | 18 | def random_string(length): 19 | letters = string.ascii_lowercase 20 | result_str = ''.join(random.choice(letters) for i in range(length)) 21 | return result_str 22 | 23 | 24 | def random_para(lim_char): 25 | para = "" 26 | count = 0 27 | while count <= lim_char: 28 | i = random.randint(3, 8) 29 | count += i 30 | word = random_string(i) 31 | para = para + " " + word 32 | if len(para) > lim_char: 33 | para = para[:lim_char] 34 | return para.strip() 35 | 36 | 37 | for i in range(30): 38 | title = random_para(50) 39 | desc = random_para(200) 40 | pub_date = timezone.now() - datetime.timedelta(days=random.randint(0, 10)) 41 | featured = True if i % 2 == 0 else False 42 | 43 | q = Question(title=title, desc=desc, 44 | pub_date=pub_date, featured=featured) 45 | q.save() 46 | 47 | for j in range(4): 48 | choice_text = random_para(100) 49 | votes = random.randint(0, 8) 50 | c = q.choice_set.create(choice_text=choice_text, votes=votes) 51 | -------------------------------------------------------------------------------- /pollsite/home/homePage.yaml: -------------------------------------------------------------------------------- 1 | topTitle_ln1 : Welcome to Canvass 2 | 3 | topTitle_ln2: Polling Application 4 | 5 | topDes : Made in India by Aahnik Daw. as on 2020 reads in 12th grade. Not serious application. Just illustrates functionality. All data or statistics shown are fake. All questions or polls are dummy. Follow me on GitHub , See Links at footer. 6 | 7 | topImg : https://github.com/aahnik/nidarzanaJAlodvahana/blob/master/Development%20Made%20Easy.png?raw=true 8 | 9 | btn1Text : Vote Now 10 | 11 | btn1Url : /poll 12 | 13 | btn2Text : Know More 14 | 15 | btn2Url : https://github.com/aahnik 16 | 17 | midTitle : Your Vote Matters 18 | 19 | midDesc : It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distr DUMMY DATA NOT REAL FILLER DATA SPAM DATA d to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum a ALL DUMMY DATA and a search 20 | 21 | 22 | 23 | teamTitle: Our Moderators and Contributers 24 | 25 | teamDesc: Everybody who contributes to the GitHub repo of this site is allowed to upload show their pic here ... 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like) DUMMY DATA , FILLER DATA SPAM DATA 26 | 27 | -------------------------------------------------------------------------------- /pollsite/poll/views.py: -------------------------------------------------------------------------------- 1 | from django.http import HttpResponse, HttpResponseRedirect 2 | from django.shortcuts import get_object_or_404, render 3 | from django.urls import reverse 4 | 5 | from .models import Choice, Question 6 | 7 | 8 | def index(request): 9 | latest_question_list = Question.objects.order_by('-pub_date') 10 | context = {'latest_question_list': latest_question_list} 11 | return render(request, 'poll/index', context) 12 | 13 | # to:LEARN add pagination 14 | 15 | 16 | def results(request, question_id): 17 | question = get_object_or_404(Question, pk=question_id) 18 | return render(request, 'poll/results', {'question': question}) 19 | 20 | 21 | def vote(request, question_id): 22 | question = get_object_or_404(Question, pk=question_id) 23 | try: 24 | selected_choice = question.choice_set.get(pk=request.POST['choice']) 25 | except (KeyError, Choice.DoesNotExist): 26 | # Redisplay the question voting form. 27 | return render(request, 'poll/vote', { 28 | 'question': question, 29 | 'error_message': "You didn't select a choice.", 30 | }) 31 | else: 32 | selected_choice.votes += 1 33 | selected_choice.save() 34 | # Always return an HttpResponseRedirect after successfully dealing 35 | # with POST data. This prevents data from being posted twice if a 36 | # user hits the Back button. 37 | return HttpResponseRedirect(reverse('poll:results', args=(question.id,))) 38 | -------------------------------------------------------------------------------- /pollsite/poll/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2020-07-15 14:50 2 | 3 | from django.db import migrations, models 4 | import django.db.models.deletion 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | initial = True 10 | 11 | dependencies = [ 12 | ] 13 | 14 | operations = [ 15 | migrations.CreateModel( 16 | name='Choice', 17 | fields=[ 18 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 19 | ('choice_text', models.CharField(max_length=100)), 20 | ('votes', models.IntegerField(default=0)), 21 | ], 22 | ), 23 | migrations.CreateModel( 24 | name='Question', 25 | fields=[ 26 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 27 | ('title', models.CharField(max_length=50, verbose_name='Question')), 28 | ('desc', models.TextField(max_length=200, verbose_name='Description')), 29 | ('pub_date', models.DateTimeField(verbose_name='Date Published')), 30 | ('featured', models.BooleanField(verbose_name='Feature in Featured Polls Page')), 31 | ], 32 | ), 33 | migrations.AddField( 34 | model_name='choice', 35 | name='question', 36 | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='poll.Question'), 37 | ), 38 | ] 39 | -------------------------------------------------------------------------------- /pollsite/home/templates/home/opensource: -------------------------------------------------------------------------------- 1 | Open Source Licences 2 | 3 |
4 |
5 |

NOW IS {{now}}

6 |
7 |

Open Source

8 |

Several fantastic pieces of free and open-source programming languages and frameworks have 9 | really helped get me do what I did like this web Application. 10 | As I enjoy giving credit where it's due, I included the entire list below. 11 | This means you can not only see which programming language / framework / tools / libraries 12 | I've been using, but the terms of the licenses too. 13 | A big thanks from the depth of my heart to all the smart people behind the fantastic stuff 14 | listed. Rock on!

15 |
    16 |
  • PYTHON LANGUAGE ( world's most popular programming language in 17 | 2020) 18 |
  • 19 |
  • DJANGO a web framework for python djangoproject.com ( 20 | World's 21 | No.1 22 | webframework in 2020)
  • 23 |
  • TAILBLOCKS(based on Tailwind CSS ) 24 | mertjf.github.io/tailblocks 25 |
  • 26 |
27 |

A BIG THANKS TO ALL WHO DEVELOPED COMPUTERS, INTERNET AND PROTOCOLS AND SO MUCH MORE

28 |

we take everything for granted , IT TAKES GREAT EFFORT TO BUILD THINGS

29 | 30 |
31 | 32 |

Thanks

33 |
34 |
-------------------------------------------------------------------------------- /pollsite/poll/templates/poll/index: -------------------------------------------------------------------------------- 1 | {% extends "base_layout.html" %} 2 | 3 | {% block title %} 4 | 5 | Canvass All Polls 6 | 7 | {% endblock %} 8 | 9 | {% block content %} 10 | 11 | {% if latest_question_list %} 12 |
13 |
14 |
15 | {% for question in latest_question_list %} 16 |
17 |
18 | {{question.pub_date.date}} 19 | {{question.participants}} Votes Recieved 20 |
21 |
22 | 23 |

{{question.title }}

24 |

{{question.desc}} 25 |

26 | {% comment %} FINDME {% endcomment %} 27 | Vote Now 29 | 31 | 32 | 33 | 34 | 35 |
36 |
37 | {% endfor %} 38 | 39 |
40 |
41 |
42 | {% else %} 43 |

No polls availaible

44 | {% endif %} 45 | 46 | {% endblock %} 47 | {{ question.question_text }} -------------------------------------------------------------------------------- /pollsite/pollsite/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for pollsite project. 3 | 4 | Generated by 'django-admin startproject' using Django 3.0.8. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/3.0/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = '3zaz_n48y63wv5xl(s9=zfrkixc-p10p1g^thb=eqs*=c3t0gp' 24 | 25 | # SECURITY WARNING: don't run with debug turned on in production! 26 | DEBUG = True 27 | 28 | ALLOWED_HOSTS = ['192.168.1.7', '127.0.0.1'] 29 | 30 | 31 | # Application definition 32 | 33 | INSTALLED_APPS = [ 34 | 'home.apps.HomeConfig', 35 | 'poll.apps.PollConfig', 36 | 'django.contrib.admin', 37 | 'django.contrib.auth', 38 | 'django.contrib.contenttypes', 39 | 'django.contrib.sessions', 40 | 'django.contrib.messages', 41 | 'django.contrib.staticfiles', 42 | ] 43 | 44 | 45 | MIDDLEWARE = [ 46 | 'django.middleware.security.SecurityMiddleware', 47 | 'django.contrib.sessions.middleware.SessionMiddleware', 48 | 'django.middleware.common.CommonMiddleware', 49 | 'django.middleware.csrf.CsrfViewMiddleware', 50 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 51 | 'django.contrib.messages.middleware.MessageMiddleware', 52 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 53 | ] 54 | 55 | ROOT_URLCONF = 'pollsite.urls' 56 | 57 | TEMPLATES = [ 58 | { 59 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 60 | 'DIRS': [os.path.join(BASE_DIR, 'templates')], 61 | 'APP_DIRS': True, 62 | 'OPTIONS': { 63 | 'context_processors': [ 64 | 'django.template.context_processors.debug', 65 | 'django.template.context_processors.request', 66 | 'django.contrib.auth.context_processors.auth', 67 | 'django.contrib.messages.context_processors.messages', 68 | ], 69 | }, 70 | }, 71 | ] 72 | 73 | WSGI_APPLICATION = 'pollsite.wsgi.application' 74 | 75 | 76 | # Database 77 | # https://docs.djangoproject.com/en/3.0/ref/settings/#databases 78 | 79 | DATABASES = { 80 | 'default': { 81 | 'ENGINE': 'django.db.backends.sqlite3', 82 | 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 83 | } 84 | } 85 | 86 | 87 | # Password validation 88 | # https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators 89 | 90 | AUTH_PASSWORD_VALIDATORS = [ 91 | { 92 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 93 | }, 94 | { 95 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 96 | }, 97 | { 98 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 99 | }, 100 | { 101 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 102 | }, 103 | ] 104 | 105 | 106 | # Internationalization 107 | # https://docs.djangoproject.com/en/3.0/topics/i18n/ 108 | 109 | LANGUAGE_CODE = 'en-us' 110 | 111 | TIME_ZONE = 'Asia/Kolkata' 112 | 113 | USE_I18N = True 114 | 115 | USE_L10N = True 116 | 117 | USE_TZ = True 118 | 119 | 120 | # Static files (CSS, JavaScript, Images) 121 | # https://docs.djangoproject.com/en/3.0/howto/static-files/ 122 | 123 | STATIC_URL = '/static/' 124 | -------------------------------------------------------------------------------- /pollsite/templates/base_layout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | {% block title %} 10 | {% comment %} title of page goes here {% endcomment %} 11 | {% endblock%} 12 | 13 | 14 | 15 | 16 | 17 |
18 | 42 |
43 | 44 | {% block content %} 45 | 46 | {% comment %} main page content goes here {% endcomment %} 47 | 48 | {%endblock%} 49 | 50 | 51 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # django-polling_site 2 | 3 | django-polling_site ( Life's First Django Project) 4 | 5 | [![GitHub license](https://img.shields.io/github/license/aahnik/django-polling_site)](https://github.com/aahnik/django-polling_site/blob/master/LICENSE) 6 | [![No Maintenance Intended | Archived](http://unmaintained.tech/badge.svg)](https://gitHub.com/aahnik/django-polling_site/graphs/commit-activity) 7 | 8 | 9 | [**SEE SCREENSHOTS**](https://github.com/aahnik/django-polling_site/tree/master/ScreenShots) 10 | 11 | ## HOW TO RUN ON YOUR COMPUTER 12 | 13 | __pre-requisites : python(3.8 or above) and pip must be installed__ 14 | 15 | 16 | 17 | **1. CREATE AND ACTIVATE A VIRTUAL ENVIRONMENT INSIDE A NEW DIRECTORY** 18 | 19 | Virtual Environments are a great way to wrap python projects. I have stopped working on this repo on Jul 15 2020. At the time of my work I have used the latest versions of python and django. If you are reading this after 2020, chances are new versions of python and django might have rolled out . So to ensure that old code runs smoothly , create a virtual environment. 20 | 21 | *Using Virtual Environments ensures the dependancies of each project is independently availaible and there is no headache of breakage of code and 22 | EVERY PROJECT STAYS INDEPENDENT OF ONE ANOTHER* 23 | 24 | IF YOU ARE NEW TO VIRTUAL ENVIRONMENTS READ [PYTHON-3 OFFICIAL DOCS](https://docs.python.org/3/library/venv.html) 25 | 26 | **2. CLONE THIS REPO `django-polling-site` IN YOUR DIRECTORY, AND INSTALL THE REQUIREMENTS** 27 | 28 | ``` 29 | pip install -r requirements.txt 30 | ``` 31 | 32 | **3. MOVE INSIDE THE `pollsite` DIRECTORY AND MAKE MIGRATIONS** 33 | 34 | ``` 35 | python manage.py makemigrations poll 36 | python manage.py makemigrations home 37 | python manage.py migrate 38 | ``` 39 | 40 | **4. CREATE A SUPERUSER , WITH YOUR OWN USERNAME AND PASSWORD** 41 | 42 | ``` 43 | python manage.py createsuperuser 44 | ``` 45 | 46 | **5. POPULATE DATABASE WITH DUMMY DATA OF QUESTIONS AND CHOICES, BY RUNNING THE `populator_script` FROM DJANGO SHELL** 47 | [click here to see how](https://github.com/aahnik/django-polling_site#running-scripts-from-django-shell) 48 | 49 | **6. Inside the `home` app directory , configure the homePage.yaml according to your wish** 50 | Inside `views.py` of same directory, put the absolute path of homePage.yaml in the place instructed. 51 | 52 | **NOW RUN THE SERVER** 53 | 54 | ``` 55 | python manage.py runserver 56 | ``` 57 | 58 | Go to http://127.0.0.1:8000/ . This is where Django starts server by default 59 | 60 | **HOLA !! ENJOY YOU HAVE SUCCESSFULLY RUN THE SERVER** 61 | 62 | Click on Admin button on top right corner to go the the Django Administration page. 63 | You can add team members , change or add questions and choices 64 | 65 | 66 | *Vist DJANGO'S OFFICIAL WEBSITE FOR MORE DETAILS..* 67 | 68 | __you can now play around with the code your self__ 69 | 70 | 71 | ## RUNNING SCRIPTs FROM DJANGO SHELL 72 | 73 | > inside apps you can't write your own scripts because they are run by django. Running a module directly will give lots of import errors 74 | 75 | _YOU WILL GET ERRORS IF YOU RUN THESE SCRIPT IN CWD CONTEXT_ 76 | 77 | DON'T RUN DIRECTLY LIKE 78 | 79 | ```shell 80 | python3 script.py 81 | ``` 82 | 83 | 84 | 85 | 86 | **The `exec()` Function** 87 | 88 | `exec()` function is used for the dynamic execution of Python program 89 | which can either be in form of a string or object code. If it is a **string**, 90 | the _string is parsed as a suite of Python statements_ which is then executed 91 | _unless a syntax error occurs_ and if it is an object code, it is simply executed. 92 | 93 | 94 | 1. START THE **DJANGO SHELL** BY RUNNING 95 | 96 | ```shell 97 | $ python3 manage.py shell 98 | ``` 99 | (because Django Shell offers special access features) 100 | 101 | 2. LOAD THE SCRIPT IN A VARIABLE 102 | 103 | ```shell 104 | >>> script = open(script_path).read() 105 | ``` 106 | 107 | 3. EXECUTE THE SCRIPT IN PYTHON CONSOLE RUNNING IN DJANGO CONTEXT 108 | 109 | ``` 110 | >>> exec(script) 111 | ``` 112 | **UPDATE : A BETTER WAY** 113 | 114 | `python3 manage.py shell < myScript.py` 115 | -------------------------------------------------------------------------------- /pollsite/home/templates/home/index: -------------------------------------------------------------------------------- 1 | {% extends "base_layout.html" %} 2 | 3 | {% block title %} 4 | 5 | Canvass Home 6 | 7 | {% endblock %} 8 | 9 | {% block content %} 10 |
11 |
12 |
14 |

{{hpe.topTitle_ln1}} 15 | {{hpe.topTitle_ln2}} 16 |

17 |

{{hpe.topDes}}

18 |
19 | 21 | 23 | 24 |
25 |
26 |
27 | hero 28 |
29 |
30 |
31 | 32 |
33 |
34 |
35 |

{{hpe.midTitle}}

36 |

{{hpe.midDesc}}

37 |
38 |
39 |
40 |
41 | 43 | 44 | 45 | 46 |

{{stats.forks}}

47 |

Downloads

48 |
49 |
50 |
51 |
52 | 54 | 55 | 56 | 57 | 58 |

{{stats.participants}}

59 |

Participants

60 |
61 |
62 |
63 |
64 | 66 | 67 | 69 | 70 | 71 |

{{stats.questions}}

72 |

Support

73 |
74 |
75 |
76 |
77 | 79 | 80 | 81 |

{{stats.choices}}

82 |

Security

83 |
84 |
85 |
86 |
87 |
88 | 89 |
90 | 91 |
92 | 93 | 94 | {% comment %} FINDME {% endcomment %} 95 |
96 | 97 |

{{hpe.teamTitle}}

98 |
99 |

{{hpe.teamDesc}}

100 |
101 |
102 | {% for member in team %} 103 |
104 |
105 | team 107 |
108 |

{{member.title}}

109 |

{{member.role}}

110 |

{{member.bio}} 111 |

112 | 113 | 114 | 116 | 117 | 118 | 119 | 120 | 122 | 124 | 125 | 126 | 127 | 128 | 130 | 132 | 133 | 134 | 135 | 136 |
137 |
138 |
139 | {% endfor %} 140 |
141 |
142 |
143 | {% endblock %} --------------------------------------------------------------------------------