An open API service indexing awesome lists of open source software.

https://github.com/misaghmomenib/django-auth-system

Django Authentication and Authorization System A Robust and Secure Authentication and Authorization System Built With Django. It Includes User Registration, Login, Logout, and Dashboard Access Control.
https://github.com/misaghmomenib/django-auth-system

auth-system django git open-source python

Last synced: 2 months ago
JSON representation

Django Authentication and Authorization System A Robust and Secure Authentication and Authorization System Built With Django. It Includes User Registration, Login, Logout, and Dashboard Access Control.

Awesome Lists containing this project

README

          

# πŸ” Django Auth System

A robust and modular **user authentication system** built with Django. It provides clean registration, login, logout, password management, and email verification flowsβ€”ready to integrate into any Django project.

---

## πŸ“‹ Table of Contents

1. [Overview](#overview)
2. [Features](#features)
3. [Tech Stack & Dependencies](#tech-stack--dependencies)
4. [Project Structure](#project-structure)
5. [Setup & Installation](#setup--installation)
6. [Usage](#usage)
7. [Security Considerations](#security-considerations)
8. [Contributing](#contributing)
9. [License](#license)

---

## πŸ’‘ Overview

This Django-based project handles common user authentication flows out-of-the-box:

- βœ… User **registration** (with email confirmation option)
- πŸ” **Login** and **logout**
- πŸ”„ **Password reset** via email
- πŸ”’ Secure password hashing and session management :contentReference[oaicite:1]{index=1}

It’s designed as a standalone app that you can incorporate into your own Django projects as a reusable authentication layer.

---

## βœ… Features

- Register new users with **email** and **username**
- Login/logout with Django’s authentication backend
- Reset forgotten passwords with **tokenized email flow**
- Optional **email confirmation** upon registration
- Profile update form (email, username, password)
- Clean, minimalistic **Bootstrap-based UI**

---

## πŸ› οΈ Tech Stack & Dependencies

- **Python 3.8+**, **Django 4.x**
- Built-in `django.contrib.auth`, `django.contrib.sessions`, `django.contrib.messages`
- **Bootstrap 5** for styling and responsive templates
- Optional Email backend (SMTP/Gmail) for confirmation flows :contentReference[oaicite:2]{index=2}
- SQLite by default (configurable for PostgreSQL/MySQL)

---

## πŸ—‚οΈ Project Structure

```

django\_auth\_system/
β”œβ”€β”€ authentication/ # Main app handling auth logic and views
β”‚ β”œβ”€β”€ templates/
β”‚ β”‚ └── authentication/ # Registration, login, password reset templates
β”‚ β”œβ”€β”€ forms.py # Custom forms for registration, login, password change
β”‚ β”œβ”€β”€ urls.py # URL routes for auth views
β”‚ └── views.py # View logic for all auth flows
β”œβ”€β”€ project/ # Django project settings and main configurations
β”‚ β”œβ”€β”€ settings.py
β”‚ β”œβ”€β”€ urls.py
└── manage.py

````

---

## βš™οΈ Setup & Installation

```bash
git clone https://github.com/MisaghMomeniB/Django-Auth-System.git
cd Django-Auth-System
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
````

Configure email settings in `project/settings.py`:

```python
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = '@gmail.com'
EMAIL_HOST_PASSWORD = ''
```

Run migrations and start the server:

```bash
python manage.py migrate
python manage.py runserver
```

---

## πŸš€ Usage

Access these routes:

* `/register/` – Create a new account
* `/login/` – Sign in to your account
* `/logout/` – Sign out
* `/password-reset/` – Request a password reset link
* `/password-reset-confirm/...` – Set a new password
* `/profile/` (optional) – Update user details

Templates are customizableβ€”update them in `authentication/templates/authentication/`.

---

## πŸ” Security Considerations

* Secure password hashing with Django’s default **PBKDF2**
* Time-limited tokens for password reset and email confirmation
* CSRF protection and session security from Django middleware
* Optional **email confirmation** to verify user addresses ([github.com][1])

---

## 🀝 Contributing

Improvements are welcome! You could add:

* Social login (OAuth) integration
* Two-factor authentication (2FA)
* Customizable email templates and styling
* Unit tests for views and form validity

**To contribute**:

1. Fork the repo
2. Create a branch (`feature/...`)
3. Implement changes with tests
4. Open a Pull Request

---

## πŸ“„ License

Distributed under the **MIT License**. See `LICENSE` file for details.