Skip to content

glitchharsh/custom-user-django

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

User Authentication with Email OR Username in Django

This is a simple Django web application that provides user authentication using both username and email.

Deployment - auth.harshp.in

Table of Contents

Objective

Create a Django web application with user authentication features, including user registration, login, basic user profile, and logout.

Requirements

  • Use Django to create a new project and a single app.
  • Implement a user registration (sign-up) page with the following fields:
    • Username
    • Email
    • Password
    • Confirm Password
  • Implement a user login page with the following fields:
    • Username or Email
    • Password
  • After successful login, redirect the user to a simple dashboard page that displays a welcome message with their username.
  • Implement a basic user profile page that displays user information. Users should only be able to access this page if they are logged in.
  • Implement a logout functionality that logs the user out and redirects them to the login page.
  • Use Django's built-in authentication system for handling user registration, login, and logout.

Additional Notes

  • Ensure the password is securely stored using Django's password hashing.
  • Implement proper form validation to handle errors during registration and login.
  • Use Django templates for rendering HTML pages.
  • Apply basic styling using CSS (you can use an external library like Bootstrap if you prefer).
  • Create a simple SQLite database to store user information.

New Features Implemented

  • Implemented Forgot Password and Change Password Features using features provided in the Django Contrib.
  • Implemented SMTP Email Backend to send an email for Forgot Password.
  • Deployed the project to auth.harshp.in with a PostgreSQL database using the deployment branch.

Setup and Run

  1. (Optional) Activate a virtual environment to isolate dependencies.
pip install virtualenv
python -m virtualenv venv
venv/Scripts/activate (Windows)
source venv/bin/activate (Linux)
  1. Clone the repository:
git clone [email protected]:glitchharsh/custom-user-django.git
cd custom-user-django
  1. Install dependencies:
pip install -r requirements.txt
  1. Apply Migrations:
python manage.py migrate
  1. Run the development server:
python manage.py runserver
  1. Visit localhost:8000 in browser to access the application.

  2. Project Walkthrough Video

Link to the video

The video came out to be longer than expected. Please watch it at 1.5x or 2x speed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published