Skip to content

sumit9165/Authentication_App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Authentication_App

Django Authentication App

A Django-based authentication system with email functionality using Mailtrap.


Requirements

Before running this project, make sure you have the following installed:

  • Python 3.10+
  • pip
  • virtualenv (recommended)
  • Git

Check Python version:

python --version

Project Setup

1. Clone the Repository

git clone https://github.com/yourusername/authentication_app.git
cd authentication_app

Create Virtual Environment

Create a virtual environment:

python -m venv venv

Activate it.

Windows

venv\Scripts\activate

Linux / Mac

source venv/bin/activate

Install Dependencies

pip install -r requirements.txt

Environment Variables (.env)

Create a .env file in the project root directory.

Example:

SECRET_KEY=your_django_secret_key
DEBUG=True

# Database (example for sqlite)
DB_NAME=db.sqlite3

# Mailtrap Email Configuration
EMAIL_HOST=sandbox.smtp.mailtrap.io
EMAIL_HOST_USER=your_mailtrap_username
EMAIL_HOST_PASSWORD=your_mailtrap_password
EMAIL_PORT=2525
EMAIL_USE_TLS=True
DEFAULT_FROM_EMAIL=hello@example.com

Mailtrap Setup

  1. Go to:
https://mailtrap.io
  1. Create an account.

  2. Go to Email Testing → SMTP Settings

  3. Copy credentials and paste them in .env.

Example credentials:

EMAIL_HOST=sandbox.smtp.mailtrap.io
EMAIL_HOST_USER=123456789
EMAIL_HOST_PASSWORD=abcdef123456
EMAIL_PORT=2525
EMAIL_USE_TLS=True

Apply Database Migrations

Run the following commands:

python manage.py makemigrations
python manage.py migrate

Create Superuser

python manage.py createsuperuser

Follow the prompts to create an admin account.


Run the Development Server

python manage.py runserver

Server will start at:

http://127.0.0.1:8000/

Access Admin Panel

Open:

http://127.0.0.1:8000/admin

Login using the superuser credentials.


Project Structure

project_root/
│
├── authentication_app/
│   ├── settings.py
│   ├── urls.py
│   ├── asgi.py
│   └── wsgi.py
│
├── manage.py
├── requirements.txt
├── .env
└── README.md

Useful Django Commands

Run migrations

python manage.py makemigrations
python manage.py migrate

Create superuser

python manage.py createsuperuser

Run development server

python manage.py runserver

Collect static files (production)

python manage.py collectstatic

Notes

  • Never commit the .env file to GitHub.
  • Add .env to .gitignore.

Example .gitignore entry:

.env
venv/
__pycache__/
db.sqlite3

License

This project is licensed under the MIT License.

About

Authentication and Authorization functionality is added in this apps, we can register as per role based (seller, customer) and it will sent an activation link on your email so that you can activate your account and login to your dashboard.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors