Skip to content

DeniDunca/Chat_App

Repository files navigation

💬 Python Django Chat Application

A web-based chat application built using Python and Django, allowing users to authenticate, send messages, upload images, and interact in dedicated chat rooms. The application supports deployment both in development and production using Docker and Nginx.

image image

Technologies Used

  • Python
  • Django
  • HTML & CSS
  • PostgreSQL
  • Docker
  • Nginx
  • FileSystemStorage (for image upload)

Features

  • User login/logout using django.contrib.auth
  • Authenticated home page showing all messages
  • Send text messages and upload images
  • File upload handling with .png validation
  • Create or join chat rooms
  • Message sending inside specific rooms
  • Development and production Docker environments
  • Media and static file handling with Nginx

Project Structure & Setup

Phase 1: Initial Setup

  1. Created a Django project.
  2. Ran the server locally at: http://localhost:8000
  3. Connected to the database for user and message storage.

Phase 2: Core Features

  • Authentication
    Implemented login and logout with authenticate, login, logout.

  • Home Page
    Displays all messages and includes message sending and logout features.

  • Send Text and Images

    • Images are stored via FileSystemStorage in the /media directory.

    • .png files are detected and rendered as image URLs in the frontend.

      image

  • Chat Rooms

    • Users can create new rooms or join existing ones.

    • Each room has its own messaging interface.

      image

Phase 3: Docker Deployment

  • Dockerized the app with:
    • Dockerfile
    • docker-compose.yml (includes PostgreSQL)
  • Created:
    • Dockerfile.prod
    • docker-compose.prod.yml
  • Configured Nginx to serve static and media files
  • Tested both development (localhost:8000) and production (localhost:1337) modes
  • Used .env.dev and .env.prod to separate configurations

Docker Commands

# Build and run containers (development)
docker-compose up --build

# Apply migrations for PostgreSQL
docker-compose exec web python manage.py migrate

Developed by Dunca Denisa Mihaela
Faculty of Computer Automation and Computer Science

About

Pyhton chat aplication with Django

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors