Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Django Authentication System

A simple Django authentication project demonstrating user registration, login, logout, and a protected dashboard using Django's built-in authentication framework.

Features

  • User Registration
  • User Login
  • User Logout
  • Protected Dashboard
  • Django Messages Framework
  • CSRF Protection
  • Session-based Authentication
  • Clean Template Structure

Tech Stack

  • Python 3.x
  • Django
  • HTML
  • SQLite (default)

Project Structure

login/
│── accounts/
│   ├── templates/
│   │   └── accounts/
│   │       ├── base.html
│   │       ├── login.html
│   │       ├── register.html
│   │       └── dashboard.html
│   ├── views.py
│   ├── urls.py
│   ├── forms.py
│   └── models.py
│
├── login/
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
│
├── manage.py
└── requirements.txt

Installation

1. Clone the repository

git clone https://github.com/umarazlan/Django-Auth.git

2. Navigate to the project

cd Django-Auth

3. Create a virtual environment

Windows

python -m venv venv
venv\Scripts\activate

Linux/macOS

python3 -m venv venv
source venv/bin/activate

4. Install dependencies

pip install -r requirements.txt

5. Apply migrations

python manage.py migrate

6. Run the development server

python manage.py runserver

Open your browser and visit:

http://127.0.0.1:8000/

Authentication Flow

Register

  • Create a new account.
  • Password validation is handled by Django.

Login

  • Authenticate using username and password.
  • User session is created after successful login.

Dashboard

  • Accessible only after authentication.
  • Displays:
    • Username
    • Email Address

Logout

  • Ends the user session.
  • Redirects back to the login page.

Templates

base.html

Provides:

  • Navigation
  • Authentication status
  • Flash messages
  • Common layout

register.html

Displays the registration form using:

{{ form.as_p }}

login.html

Contains a custom login form with:

  • Username
  • Password
  • CSRF Protection

dashboard.html

Displays logged-in user information.


Security Features

  • CSRF Protection
  • Django Authentication Framework
  • Password Hashing
  • Session Authentication
  • Login Required Access

Future Improvements

  • Password Reset via Email
  • User Profile Page
  • Profile Picture Upload
  • Email Verification
  • Remember Me Option
  • Bootstrap UI
  • Custom User Model
  • Responsive Design

Author

Umar Azlan

GitHub: https://github.com/umarazlan


License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages