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.
- Host: GitHub
- URL: https://github.com/misaghmomenib/django-auth-system
- Owner: MisaghMomeniB
- License: mit
- Created: 2025-04-28T07:39:04.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-13T20:02:31.000Z (about 1 year ago)
- Last Synced: 2025-06-13T21:19:07.556Z (about 1 year ago)
- Topics: auth-system, django, git, open-source, python
- Language: Python
- Homepage:
- Size: 66.4 KB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.