Django All Auth Implementation

Technologies Used
Python Django HTML CSS Bootstrap Javascript Postgres Heroku Github

Third Eye | Django All Auth Implementation

Description


This project is implementation for the following topics related to technologies used with Django


--Implemented Complete Auth Using Django All Auth @https://django-allauth.readthedocs.io/en/latest/installation.html.

  1. Django All Auth built in Django Auth Model
  2. You can log in with a username/email/social accounts
  3. Login. SingUp, Logout, Account Views Implemented
  4. In built views of PasswordChangeDoneView, PasswordChangeView, PasswordResetCompleteView, PasswordResetConfirmView, PasswordResetView, PasswordResetCompleteView
  5. Build Custom Templates for These Inbuilt Views
  6. Build custom templates for a lot of functionalities, you just have to place template with same name inside same location which would be used by all auth
  7. Used GitHub Social Login and Google social Login
  8. Google Social Login don't work properly since It's for development phase and have to add user to list who can log in
  9. Moreover, we can merge different social logins into one account with all auth.

-Implemented Crud Operations with Django Forms

  1. build crud operation create, update, delete, read function views
  2. build templates for handling it
  3. Created Django forms

-Deployed on Hostinger VPS

  1. Used Heroku Postgres

Demo


Available at: https://owl-eyes.arpansahu.me/

admin login details:-- email: admin@arpansahu.me username: admin password: showmecode


License


MIT


Installation


Installing Pre requisites

pip install -r requirements.txt

Making Migrations and Migrating them.

python manage.py makemigrations
python manage.py migrate

Creating Super User.

python manage.py createsuperuser

Run Server.

python manage.py runserver

Deployment on Heroku


Installing Heroku Cli

checkout: https://devcenter.heroku.com/articles/heroku-cli

Create your account in Heroku.

Inside your project directory

Login Heroku CLI

heroku login

Create Heroku App

heroku create [app_name]

Push Heroku App

git push heroku master

Configure Heroku App Env Variables

heroku config:set GITHUB_USERNAME=joesmith

Configuring Django App for Heroku


Install whitenoise

pip install whitenoise

Include it in Middlewares.

MIDDLEWARE = [
    # ...
    "django.middleware.security.SecurityMiddleware",
    "whitenoise.middleware.WhiteNoiseMiddleware",
    # ...
]

Create Procfile and include this code snippet in it.

release: ./release-tasks.sh
web: gunicorn djangoProject.wsgi

Create release-task.sh for running multilple commands in run: section of procfile.

python manage.py makemigrations
python manage.py migrate

Make release-task.sh executable

chmod +x release-tasks.sh

Environment Variables


To run this project, you will need to add the following environment variables to your .env file

SECRET_KEY=
DEBUG=
DB_HOST=
DB_NAME=
DB_USER=
DB_PASSWORD=
DB_PORT=
EMAIL_USER=
EMAIL_PASS=
ALLOWED_HOSTS=