Skip to content

This project is a Django-based authentication system that provides user registration, login, logout, and authentication management using JWT.

Notifications You must be signed in to change notification settings

alexander784/django_auth-with-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 

Repository files navigation

Django Authentication System with Docker

This is a Django authentication system fully containerized using Docker. It provides user registration, login, logout, and authentication management using Django's built-in authentication system. The application is designed to be deployable and scalable with ease using PostgreSQL as the database.

Features

  • User Authentication (Register, Login, Logout)
  • Django Admin Panel
  • PostgreSQL Integration
  • Dockerized for Easy Deployment

Tech Stack

  • Backend: Django
  • Database: PostgreSQL 14
  • Containerization: Docker & Docker Compose

Getting started

Prerequisites

Ensure you have the following installed:

  • Python3
  • Django
  • Docker
  • Docker compose

Usage

  1. CLone the Repo
    git clone https://github.com/alexander784/django_auth-with-docker.git

  2. Build and Run the conatiners
    docker-compose up --build -d

  3. Apply migrations
    docker-compose exec web python manage.py migrate

  4. Access the App

Project Structure

├── auth
│ ├── settings.py
│ ├── urls.py
│ ├── wsgi.py
│ ├── asgi.py
├── ruhusa/ │ ├── models.py
│ ├── views.py
│ ├── urls.py
├── templates/
├── docker-compose.yml
├── Dockerfile
├── requirements.txt ├── manage.py

Docker Configuration

Dockerfile

FROM python:3.10
WORKDIR /code
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]

Docker-compose

version: '3.10.12'
services:
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
- db
db:
image: postgres:14
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- postgres_data:/var/lib/postgresql/data/
volumes:
postgres_data:

Running the Docker cont

sudo docker-compose up -d -Start the containers.
sudo docker-compose down- Stop and remove containers
docker-compose exec web python manage.py migrate - Apply MIgrations
docker-compose logs -f View container log

License

This project is licensed under the MIT License. See LICENSE for details.

Author

Alexander Nyaga.

About

This project is a Django-based authentication system that provides user registration, login, logout, and authentication management using JWT.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published