Giter Club home page Giter Club logo

devmahmud / django-poll-app Goto Github PK

View Code? Open in Web Editor NEW
282.0 11.0 159.0 2.86 MB

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.

License: MIT License

Python 60.04% HTML 39.42% CSS 0.54%
django-application django-project bootstrap4 django

django-poll-app's Introduction

Django-Poll-App

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.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

python== 3.5 or up and django==2.0 or up

Installing

open terminal and type
git clone https://github.com/devmahmud/Django-poll-app.git

or simply download using the url below

https://github.com/devmahmud/Django-poll-app.git

To migrate the database open terminal in project directory and type

python manage.py makemigrations
python manage.py migrate

To use admin panel you need to create superuser using this command

python manage.py createsuperuser

To Create some dummy text data for your app follow the step below:

pip install faker python manage.py shell import seeder seeder.seed_all(30)

Here 30 is a number of entry. You can use it as your own

Configuring OAuth login

Obtaining OAuth Client ID for Google
  1. Go to the Google Cloud Console:

  2. Create a new project:

    • Click on the project dropdown menu at the top of the page.
    • Click on "New Project" and follow the prompts to create a new project.
  3. Enable the Google Identity service:

    • In the Google Cloud Console, navigate to "APIs & Services" > "Dashboard."
    • Click on "Enable APIs and Services."
    • Search for "Google Identity" or "Google+ API" and enable it for your project.
  4. Create OAuth consent screen:

    • In the Google Cloud Console, navigate to "APIs & Services" > "OAuth consent screen."
    • Fill in the required fields (like application name, user support email, etc.).
    • Add scopes (permissions) your application requires.
    • Save the consent screen information.
  5. Create OAuth credentials:

    • In the Google Cloud Console, navigate to "APIs & Services" > "Credentials."
    • Click on "Create Credentials" > "OAuth client ID."
    • Select "Web application" as the application type.
    • Enter a name for your OAuth client.
    • Add authorized redirect URIs : http://127.0.0.1:8000/complete/google-oauth2/
    • Click "Create."
  6. Copy the client ID and client secret:

    • Once the OAuth client is created, you'll see your client ID and client secret.

    • Copy these values and update the following variables in settings.py

      SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = 'your-client-id'
      SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = 'your-client-secret'
      

For detailed instructions, refer to Google's documentation on OAuth 2.0.

Obtaining OAuth Client ID for LinkedIn

Step 1: Create a LinkedIn App

  1. Go to the LinkedIn Developer Portal and sign in.
  2. Click on "Create App" and fill in the required details, such as the app name, description, and logo.
  3. In the "Authorized Redirect URLs" section, add the callback URL for your Django app. This URL will be like http://127.0.0.1:8000/complete/linkedin/.
  4. Save the changes and note down the Client ID and Client Secret provided by LinkedIn.

Step 2: Configure Django Settings

1. Update the following settings to your settings file, replacing `'your-linkedin-client-id'` and `'your-linkedin-client-secret'` with your actual LinkedIn app credentials:
 ```python
 SOCIAL_AUTH_LINKEDIN_OAUTH2_KEY = 'your-client-id'
 SOCIAL_AUTH_LINKEDIN_OAUTH2_SECRET = 'your-client-secret'
 ```

To run the program in local server use the following command

python manage.py runserver

Then go to http://127.0.0.1:8000 in your browser

Project snapshot

Home page

Login Page

Registration Page

Poll List Page

Poll Add Page

Polling page

Poll Result Page

Poll Edit Page

Choice Update Delete Page

Author

Mahmudul alam
Email: [email protected]

========Thank You !!!=========

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.