├── pollme ├── __init__.py ├── views.py ├── wsgi.py ├── urls.py └── settings.py ├── polls ├── __init__.py ├── migrations │ ├── __init__.py │ ├── 0002_auto_20231018_1318.py │ └── 0001_initial.py ├── apps.py ├── urls.py ├── admin.py ├── templates │ └── polls │ │ ├── add_poll.html │ │ ├── poll_detail.html │ │ ├── add_choice.html │ │ ├── endpoll.html │ │ ├── poll_edit.html │ │ ├── poll_result.html │ │ └── polls_list.html ├── forms.py ├── tests.py ├── models.py └── views.py ├── accounts ├── __init__.py ├── migrations │ └── __init__.py ├── models.py ├── admin.py ├── tests.py ├── apps.py ├── urls.py ├── forms.py ├── templates │ └── accounts │ │ ├── register.html │ │ └── login.html └── views.py ├── .vscode └── settings.json ├── requirements.txt ├── static ├── img │ └── background.jpg └── css │ └── home_style.css ├── .gitignore ├── manage.py ├── templates ├── home.html ├── includes │ └── navbar.html └── base.html ├── LICENSE ├── README.md └── seeder.py /pollme/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /polls/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /accounts/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /polls/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /accounts/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /accounts/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /accounts/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /accounts/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.3.1 2 | "Django>=4.2,<4.3" 3 | pytz==2020.5 4 | sqlparse==0.4.4 5 | -------------------------------------------------------------------------------- /static/img/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devmahmud/Django-Poll-App/HEAD/static/img/background.jpg -------------------------------------------------------------------------------- /polls/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class PollsConfig(AppConfig): 5 | name = 'polls' 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | *.pot 3 | *.pyc 4 | __pycache__/ 5 | local_settings.py 6 | db.sqlite3 7 | media 8 | venv 9 | .vscode -------------------------------------------------------------------------------- /accounts/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class AccountsConfig(AppConfig): 5 | name = 'accounts' 6 | -------------------------------------------------------------------------------- /pollme/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | 4 | def home(request): 5 | return render(request,'home.html') -------------------------------------------------------------------------------- /accounts/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | 4 | app_name = "accounts" 5 | 6 | urlpatterns=[ 7 | path('login/', views.login_user, name='login'), 8 | path('logout/', views.logout_user, name='logout'), 9 | path('register/', views.create_user, name='register'), 10 | ] -------------------------------------------------------------------------------- /static/css/home_style.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | height:100%; 3 | padding: 0; 4 | margin: 0; 5 | color: white; 6 | } 7 | html{ 8 | background-image: url('../img/background.jpg'); 9 | background-size: cover; 10 | } 11 | body { 12 | background: rgba(0, 0, 0, 0.466); 13 | } 14 | #home-content{ 15 | text-align: center; 16 | padding-top: 20%; 17 | } -------------------------------------------------------------------------------- /pollme/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for pollme 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/2.1/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', 'pollme.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == '__main__': 6 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'pollme.settings') 7 | try: 8 | from django.core.management import execute_from_command_line 9 | except ImportError as exc: 10 | raise ImportError( 11 | "Couldn't import Django. Are you sure it's installed and " 12 | "available on your PYTHONPATH environment variable? Did you " 13 | "forget to activate a virtual environment?" 14 | ) from exc 15 | execute_from_command_line(sys.argv) 16 | -------------------------------------------------------------------------------- /templates/home.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load static %} 3 | {% block custom_css %} 4 | 5 | {% endblock custom_css %} 6 | 7 | 8 | {% block content %} 9 |
Already have an account? Login Here
8 | {% if messages %} 9 | 18 | {% endif %} 19 | 24 |Don't have an account? Sign 37 | Up
38 |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.githttps://github.com/devmahmud/Django-poll-app.gitpython manage.py makemigrationspython 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 |
41 |
46 |
51 |
56 |
61 |
66 |
71 |
76 |
81 | 85 | Mahmudul alam88 | 89 |
86 | Email: expelmahmud@gmail.com 87 |